WSAEventSelect Function
Windows Sockets API
The WSAEventSelect
function associates a Windows event object with a set of socket network events and collects all network events that occur for that socket into the specified event object.
Syntax
int WSAEventSelect(
SOCKET s,
WSAEVENT hEventObject,
long lNetworkEvents
);
Parameters
Parameter | Description |
---|---|
s |
A descriptor identifying an unbound socket. |
hEventObject |
A handle to a Windows event object created by a call to WSACreateEvent . |
lNetworkEvents |
A bitmask that specifies the network events to be associated with the event object. This parameter can be a combination of the following values:
|
Return Value
Value | Description |
---|---|
0 |
If the function succeeds. |
SOCKET_ERROR (-1) |
If the function fails. The specific error code can be retrieved by calling WSAGetLastError . |
Remarks
The If When Once registered, whenever one of the specified network events occurs on the socket, the event object associated with the socket is set. The application can then use After an event has been detected, the event object remains set until the application calls
|
WSAEventSelect
. Otherwise, Windows Sockets cannot signal events.
WSACleanup
when your application is finished using Windows Sockets.
Requirements
Minimum supported client: Windows 2000 Professional
Minimum supported server: Windows 2000 Server
Header: winsock2.h
Library: Ws2_32.lib
DLL: Ws2_32.dll