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

# XGameStreamingGetConnectionState

> XGameStreamingGetConnectionState

# XGameStreamingGetConnectionState

Gets the current connection state for specified device.

## Syntax

```cpp theme={null}
XGameStreamingConnectionState XGameStreamingGetConnectionState(  
         XGameStreamingClientId client  
)  
```

### Parameters

*client*   \_In\_\
Type: XGameStreamingClientId

The client to request the connection state of.

### Return value

Type: [XGameStreamingConnectionState](/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate)

## Remarks

This API returns the [XGameStreamingConnectionState](/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate) of the specified client.   This allows for a check to see if the device has disconnected since the game last checked.

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)\
[XGameStreamingGetClients](/reference/system/xgamestreaming/functions/xgamestreaminggetclients)\
[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members)


## Related topics

- [XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members.md)
- [Unity C# API wrappers for the GDK](/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XGameStreamingConnectionState](/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate.md)
- [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged.md)
- [XGameStreamingConnectionStateChangedCallback](/reference/system/xgamestreaming/functions/xgamestreamingconnectionstatechangedcallback.md)
