WebSocketCompleteAction function
The WebSocketCompleteAction function completes an action started by WebSocketGetAction.
Syntax
VOID WINAPI WebSocketCompleteAction( _In_ WEB_SOCKET_HANDLE hWebSocket, _In_ PVOID pvActionContext, _In_ ULONG ulBytesTransferred );
Parameters
- hWebSocket [in]
-
Type: WEB_SOCKET_HANDLE
WebSocket session handle returned by a previous call to WebSocketCreateClientHandle or WebSocketCreateServerHandle.
- pvActionContext [in]
-
Type: PVOID
Pointer to an action context handle that was returned by a previous call to WebSocketGetAction.
- ulBytesTransferred [in]
-
Type: ULONG
Number of bytes transferred for the WEB_SOCKET_SEND_TO_NETWORK_ACTION or WEB_SOCKET_RECEIVE_FROM_NETWORK_ACTION actions. This value must be 0 for all other actions.
Return value
If the function succeeds, it returns S_OK.
If the function fails, it returns a system error code defined in WinError.h.
Remarks
Each call to WebSocketGetAction must be paired with a call to WebSocketCompleteAction. For the following network actions, I/O errors can occur:
- WEB_SOCKET_SEND_TO_NETWORK_ACTION: if ulBytesTransferred is different than the sum all buffer lengths returned from WebSocketGetAction the current send action is canceled and the next call to WebSocketGetAction will return WEB_SOCKET_INDICATE_SEND_COMPLETE_ACTION even if not all buffers passed to WebSocketSend were processed.
- WEB_SOCKET_RECEIVE_FROM_NETWORK_ACTION: if ulBytesTransferred is 0, the current receive action is canceled and the next call to WebSocketGetAction will return WEB_SOCKET_INDICATE_RECEIVE_COMPLETE_ACTION even if not all buffers passed to WebSocketReceive were processed.
Requirements
|
Minimum supported client | Windows 8 [desktop apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also