Skip to main content
Optionally allows the caller to implement the WebSocket functions.

Syntax

Parameters

websocketConnectFunc   _In_
Type: HCWebSocketConnectFunction
A callback that implements the WebSocket connect operation. This callback is required. websocketSendMessageFunc   _In_
Type: HCWebSocketSendMessageFunction
A callback that implements sending a text message. This callback is required. websocketSendBinaryMessageFunc   _In_
Type: HCWebSocketSendBinaryMessageFunction
A callback that implements sending a binary message. This callback is required. websocketDisconnectFunc   _In_
Type: HCWebSocketDisconnectFunction
A callback that implements the WebSocket disconnect operation. This callback is required. context   _In_opt_
Type: void*
The context pointer for the callbacks.

Return value

Type: HRESULT Returns S_OK on success, E_INVALIDARG if any callback is nullptr, or E_HC_ALREADY_INITIALISED if libHttpClient is already initialized.

Remarks

Call this function before HCInitialize. After libHttpClient is initialized, the function returns E_HC_ALREADY_INITIALISED. You must provide all four callbacks. If any callback is nullptr, the function returns E_INVALIDARG. To keep the built-in WebSocket implementation, don’t call this function.

Requirements

Header: httpProvider.h Library: libHttpClient.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

See also

httpProvider
Last modified on October 30, 2026