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

# XGameStreamingGetClients

> XGameStreamingGetClients

# XGameStreamingGetClients

Gets the ID of each currently connected client.

## Syntax

```cpp theme={null}
HRESULT XGameStreamingGetClients(  
         uint32_t clientCount,  
         XGameStreamingClientId* clients,  
         uint32_t* clientsUsed  
)  
```

### Parameters

*clientCount*   \_In\_\
Type: uint32\_t

Maximum number of clients to return in the clients array.

*clients*   \_Out\_writes\_to\_(clientCount,*clientsUsed)\
Type: XGameStreamingClientId*

Buffer to store the connected client IDs.

*clientsUsed*   \_Out\_\
Type: uint32\_t\*

The number of clients actually written to the clients array.

### Return value

Type: HRESULT

Returns **S\_OK** if successful; otherwise, returns an error code.

#### Potential Errors

| Error Code                         | Error Value | Reason for Error                                                                                                                                                                     |
| ---------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| E\_GAMESTREAMING\_NOT\_INITIALIZED | 0x89245400  | The XGameStreaming runtime has not been initialized. Call [XGameStreamingInitialize](/reference/system/xgamestreaming/functions/xgamestreaminginitialize) before calling other APIs. |
| E\_NOT\_SUFFICIENT\_BUFFER         | 0x7A        | The number specified in clientCount is smaller than the number of currently connected clients.                                                                                       |

For a list of error codes, see [Error Codes](/reference/errorcodes).

## Remarks

Used to get the `XGameStreamingClientId` of every streaming client device that is currently connected.

If the game is only trying to identify if ANY device is connected and streaming, consider using [XGameStreamingIsStreaming](/reference/system/xgamestreaming/functions/xgamestreamingisstreaming).

If the game needs to get notification when a streaming client connects and/or disconnects, consider using [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged).

## Requirements

**Header:** xgamestreaming.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

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


## Related topics

- [XGameStreamingGetClientCount](/reference/system/xgamestreaming/functions/xgamestreaminggetclientcount.md)
- [XGameStreamingGetConnectionState](/reference/system/xgamestreaming/functions/xgamestreaminggetconnectionstate.md)
- [XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members.md)
- [Optimizing your game for XBOX Game Streaming](/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
- [XGameStreamingClientProperty](/reference/system/xgamestreaming/enums/xgamestreamingclientproperty.md)
