> ## 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 callback function invoked whenever the state of a connected streaming client changes.

<a id="syntaxSection" />

## Syntax

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

<a id="parametersSection" />

### Parameters

*context*   \_In\_opt\_\
Type: void\*

Context which was supplied when the event was subscribed to.

*client*   \_In\_\
Type: XGameStreamingClientId

Client streaming device which the event references.

*state*   \_In\_\
Type: [XGameStreamingConnectionState](/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate)

New connection state of the client.

<a id="retvalSection" />

### Return value

Type: void

<a id="remarksSection" />

## Remarks

The `XGameStreamingClientChangedCallback` is invoked whenever a streaming device connects or disconnects.

Upon registration, this callback is also invoked for each connected device.

Upon registering via [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged), the callback is also invoked for devices that are already connected.

<a id="requirementsSection" />

## Requirements

**Header:** xgamestreaming.h

**Library:** xgameruntime.lib

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

<a id="seealsoSection" />

## See also

[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](/reference/system/xgamestreaming/functions/xgamestreamingunregisterconnectionstatechanged.md)
- [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged.md)
- [XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members.md)
- [XGameStreamingUnregisterClientPropertiesChanged](/reference/system/xgamestreaming/functions/xgamestreamingunregisterclientpropertieschanged.md)
- [XGameStreamingConnectionState](/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate.md)
