The WSACloseEvent function closes an open event object handle.
BOOL WSACloseEvent(
WSAEVENT hEvent
)
hEvent
Type: WSAEVENT
[in] Object handle identifying the open event.
Type: BOOL
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.
| Return code | Description |
|---|---|
| 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 is not a valid event object handle. |
The WSACloseEvent function closes the handle to an event object and frees resources associated with the event object. This function is used to close a handle created by the WSACreateEvent function. Once the handle to the event object is closed, further references to this handle will fail with the error WSA_INVALID_HANDLE.
Windows Phone 8: This API is supported.
Header: Declared in winsock2.h.
Library: Use ws2_32.lib.