> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# HCSetWebSocketFunctions

> HCSetWebSocketFunctions

# HCSetWebSocketFunctions

Optionally allows the caller to implement the WebSocket functions.

## Syntax

```cpp theme={null}
HRESULT HCSetWebSocketFunctions(  
         HCWebSocketConnectFunction websocketConnectFunc,  
         HCWebSocketSendMessageFunction websocketSendMessageFunc,  
         HCWebSocketSendBinaryMessageFunction websocketSendBinaryMessageFunc,  
         HCWebSocketDisconnectFunction websocketDisconnectFunc,  
         void* context  
)  
```

### Parameters

*websocketConnectFunc*   \_In\_\
Type: HCWebSocketConnectFunction

A callback that implements WebSocket connect function as desired. Pass in nullptr to use the default implementation based on the current platform.

*websocketSendMessageFunc*   \_In\_\
Type: HCWebSocketSendMessageFunction

A callback that implements WebSocket send message function as desired. Pass in nullptr to use the default implementation based on the current platform.

*websocketSendBinaryMessageFunc*   \_In\_\
Type: HCWebSocketSendBinaryMessageFunction

A callback that implements WebSocket send binary message function as desired. Pass in nullptr to use the default implementation based on the current platform.

*websocketDisconnectFunc*   \_In\_\
Type: HCWebSocketDisconnectFunction

A callback that implements WebSocket disconnect function as desired. Pass in nullptr to use the default implementation based on the current platform.

*context*   \_In\_opt\_\
Type: void\*

The context pointer for the callbacks.

### Return value

Type: HRESULT

Result code for this API operation. Possible values are S\_OK, or E\_FAIL.

## Requirements

**Header:** httpProvider.h

**Library:** libHttpClient.GDK.lib

## See also

[httpProvider](/reference/live/httpclient/httpprovider/httpprovider_members)
