> ## 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.

# HCGetWebSocketFunctions

> HCGetWebSocketFunctions

# HCGetWebSocketFunctions

获取实现 WebSocket 功能的函数。

## Syntax

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

### Parameters

*websocketConnectFunc*   \_Out\_\
Type: HCWebSocketConnectFunction\*

按所需方式实现 WebSocket 连接函数的回调。

*websocketSendMessageFunc*   \_Out\_\
Type: HCWebSocketSendMessageFunction\*

按所需方式实现 WebSocket 发送消息函数的回调。

*websocketSendBinaryMessageFunc*   \_Out\_\
Type: HCWebSocketSendBinaryMessageFunction\*

按所需方式实现 WebSocket 发送二进制消息函数的回调。

*websocketDisconnectFunc*   \_Out\_\
Type: HCWebSocketDisconnectFunction\*

按所需方式实现 WebSocket 断开连接函数的回调。

*context*   \_Out\_\
Type: void\*\*

回调的上下文指针。

### Return value

Type: HRESULT

此 API 操作的结果代码。可能的值为 S\_OK 或 E\_FAIL。

## Requirements

**Header:** httpProvider.h

**Library:** libHttpClient.GDK.lib

## See also

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


## Related topics

- [HCWebSocketGetEventFunctions](/zh-CN/reference/live/httpclient/httpclient/functions/hcwebsocketgeteventfunctions.md)
- [HCWebSocketGetHeader](/zh-CN/reference/live/httpclient/httpprovider/functions/hcwebsocketgetheader.md)
- [HCWebSocketGetHeaderAtIndex](/zh-CN/reference/live/httpclient/httpprovider/functions/hcwebsocketgetheaderatindex.md)
- [HCWebSocketGetNumHeaders](/zh-CN/reference/live/httpclient/httpprovider/functions/hcwebsocketgetnumheaders.md)
- [HCGetWebSocketConnectResult](/zh-CN/reference/live/httpclient/httpclient/functions/hcgetwebsocketconnectresult.md)
