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

# XGameStreamingGetClientCount

> XGameStreamingGetClientCount

# XGameStreamingGetClientCount

获取当前正在流式播放游戏的客户端数量。

## 语法

```cpp theme={null}
uint32_t XGameStreamingGetClientCount()
```

### 参数

无

### 返回值

类型：uint32\_t

返回当前正在流式播放游戏的客户端数量。

## 备注

返回当前正在流式播放游戏的客户端数量。如果当前没有客户端正在进行流式处理，此值可能为零。

在调用 [XGameStreamingGetClients](/reference/system/xgamestreaming/functions/xgamestreaminggetclients) 分配内存之前，使用此项获取已连接设备的数量。

如果游戏仅尝试识别是否有任何设备已连接并进行流式处理，请考虑使用 [XGameStreamingIsStreaming](/reference/system/xgamestreaming/functions/xgamestreamingisstreaming)。

如果游戏希望在流式处理客户端连接和/或断开连接时收到通知，请考虑使用 [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged)。

## 要求

**标头：** xgamestreaming.h\
**库：** xgameruntime.lib\
**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

[XGameStreamingIsStreaming](/reference/system/xgamestreaming/functions/xgamestreamingisstreaming)\
[XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged)\
[XGameStreamingGetClients](/reference/system/xgamestreaming/functions/xgamestreaminggetclients)\
[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members)


## Related topics

- [XGameStreamingGetClients](/zh-CN/reference/system/xgamestreaming/functions/xgamestreaminggetclients.md)
- [XGameStreamingGetConnectionState](/zh-CN/reference/system/xgamestreaming/functions/xgamestreaminggetconnectionstate.md)
- [XGameStreaming](/zh-CN/reference/system/xgamestreaming/xgamestreaming_members.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XGameStreamingClientPropertiesChangedCallback](/zh-CN/reference/system/xgamestreaming/functions/xgamestreamingclientpropertieschangedcallback.md)
