WSASetEvent function (winsock2.h)

The WSASetEvent function sets the state of the specified event object to signaled.

Syntax

BOOL WSAAPI WSASetEvent(
  [in] WSAEVENT hEvent
);

Parameters

[in] hEvent

Handle that identifies an open event object.

Return value

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To get extended error information, call WSAGetLastError.

Error code Meaning
WSANOTINITIALISED
A successful WSAStartup call must occur before using this function.
WSAENETDOWN
The network subsystem has failed.
WSAEINPROGRESS
A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function.
WSA_INVALID_HANDLE
The hEvent parameter is not a valid event object handle.

Remarks

The WSASetEvent function sets the state of the event object to be signaled.

Windows Phone 8: This function is supported for Windows Phone Store apps on Windows Phone 8 and later.

Windows 8.1 and Windows Server 2012 R2: This function is supported for Windows Store apps on Windows 8.1, Windows Server 2012 R2, and later.

Requirements

Requirement Value
Minimum supported client Windows 8.1, Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header winsock2.h
Library Ws2_32.lib
DLL Ws2_32.dll

See also

WSACloseEvent

WSACreateEvent

WSAResetEvent

Winsock Functions

Winsock Reference