WSACloseEvent function
The WSACloseEvent function closes an open event object handle.
Syntax
BOOL WSACloseEvent( _In_ WSAEVENT hEvent );
Parameters
- hEvent [in]
-
Object handle identifying the open event.
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 |
|---|---|
|
A successful WSAStartup call must occur before using this function. | |
|
The network subsystem has failed. | |
|
A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function. | |
|
The hEvent is not a valid event object handle. |
Remarks
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 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
|
Minimum supported client |
Windows 8.1, Windows Vista [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2003 [desktop apps | Windows Store apps] |
|
Minimum supported phone |
Windows Phone 8 |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- Winsock Reference
- Winsock Functions
- WSACreateEvent
- WSAEnumNetworkEvents
- WSAEventSelect
- WSAGetOverlappedResult
- WSARecv
- WSARecvFrom
- WSAResetEvent
- WSASend
- WSASendTo
- WSASetEvent
- WSAWaitForMultipleEvents