> ## 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](/zh-TW/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate)

用戶端的新連線狀態。

<a id="retvalSection" />

### 傳回值

類型：void

<a id="remarksSection" />

## 備註

每當串流裝置連線或中斷連線時，就會叫用 `XGameStreamingClientChangedCallback`。

註冊時，也會針對每個已連線的裝置叫用此回呼。

透過 [XGameStreamingRegisterConnectionStateChanged](/zh-TW/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged) 註冊時，也會針對已連線的裝置叫用回呼。

<a id="requirementsSection" />

## 需求

**標頭：** xgamestreaming.h

**程式庫：** xgameruntime.lib

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

<a id="seealsoSection" />

## 另請參閱

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


## Related topics

- [XGameStreamingConnectionStateChangedCallback](/reference/system/xgamestreaming/functions/xgamestreamingconnectionstatechangedcallback.md)
- [XGameStreamingUnregisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingunregisterconnectionstatechanged.md)
