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

# XGameStreamingConnectionStateChangedCallback

> XGameStreamingConnectionStateChangedCallback

# XGameStreamingConnectionStateChangedCallback

每当连接的流式处理客户端状态发生更改时调用的回调函数。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
void XGameStreamingConnectionStateChangedCallback(
         void* context,
         XGameStreamingClientId client,
         XGameStreamingConnectionState state
)
```

<a id="parametersSection" />

### 参数

*context*   \_In\_opt\_\
类型：void\*

订阅事件时提供的上下文。

*client*   \_In\_\
类型：XGameStreamingClientId

事件引用的客户端流式处理设备。

*state*   \_In\_\
类型：[XGameStreamingConnectionState](/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate)

客户端的新连接状态。

<a id="retvalSection" />

### 返回值

类型：void

<a id="remarksSection" />

## 备注

每当流式处理设备连接或断开连接时，就会调用 `XGameStreamingClientChangedCallback`。

注册后，也会为每个已连接的设备调用此回调。

通过 [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged) 注册后，也会为已连接的设备调用回调。

<a id="requirementsSection" />

## 要求

**标头：** xgamestreaming.h

**库：** xgameruntime.lib

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

<a id="seealsoSection" />

## 另请参阅

[XGameStreamingConnectionState](/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate)\
[XGameStreamingUnregisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingunregisterconnectionstatechanged)\
[XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged)\
[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members)


## Related topics

- [XGameStreamingUnregisterConnectionStateChanged](/zh-CN/reference/system/xgamestreaming/functions/xgamestreamingunregisterconnectionstatechanged.md)
- [XGameStreamingRegisterConnectionStateChanged](/zh-CN/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged.md)
- [XGameStreaming](/zh-CN/reference/system/xgamestreaming/xgamestreaming_members.md)
- [XGameStreamingUnregisterClientPropertiesChanged](/zh-CN/reference/system/xgamestreaming/functions/xgamestreamingunregisterclientpropertieschanged.md)
- [XGameStreamingConnectionState](/zh-CN/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate.md)
