Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The WebSocketCompleteAction function completes an action started by WebSocketGetAction.
Syntax
void WebSocketCompleteAction(
[in] WEB_SOCKET_HANDLE hWebSocket,
[in] PVOID pvActionContext,
[in] ULONG ulBytesTransferred
);
Parameters
[in] hWebSocket
Type: WEB_SOCKET_HANDLE
WebSocket session handle returned by a previous call to WebSocketCreateClientHandle or WebSocketCreateServerHandle.
[in] pvActionContext
Type: PVOID
Pointer to an action context handle that was returned by a previous call to WebSocketGetAction.
[in] ulBytesTransferred
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
Requirement | Value |
---|---|
Minimum supported client | Windows 8 [desktop apps only] |
Minimum supported server | Windows Server 2012 [desktop apps only] |
Target Platform | Windows |
Header | websocket.h |
Library | Websocket.lib |
DLL | Websocket.dll |