The WinHttpWebSocketReceive function receives data from a WebSocket connection.
WINHTTPAPI DWORD WinHttpWebSocketReceive( HINTERNET hWebSocket, PVOID pvBuffer, DWORD dwBufferLength, DWORD *pdwBytesRead, WINHTTP_WEB_SOCKET_BUFFER_TYPE *peBufferType );
Handle to a WebSocket.
Pointer to a buffer to receive the data.
Length of pvBuffer, in bytes.
Pointer to a DWORD that receives the number of bytes read from the connection at the end of the operation. This is set only if WinHttpWebSocketReceive returns NO_ERROR and the handle was opened in synchronous mode.
The type of a returned buffer. This is only set if WinHttpWebSocketReceive returns NO_ERROR and the handle was opened in synchronous mode.
NO_ERROR on success. Otherwise an error code.
||A close or send is pending, or the receive channel has already been closed.|
||A parameter is invalid.|
||Invalid data was received from the server.|
||The operation was cancelled because WinHttpWebSocketClose was called to close the connection.|
|Minimum supported client||Windows 8 [desktop apps only]|
|Minimum supported server||Windows Server 2012 [desktop apps only]|