> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XGameStreamingConnectionStateChangedCallback

> XGameStreamingConnectionStateChangedCallback

A callback function invoked whenever the state of a connected streaming client changes.

## Syntax

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

### 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](https://docs.xbox.com/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate.md)

New connection state of the client.

### Return value

Type: void

## 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](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged.md), the callback is also invoked for devices that are already connected.

## Requirements

**Header:** xgamestreaming.h

**Library:** xgameruntime.lib

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

## See also

[XGameStreamingConnectionState](https://docs.xbox.com/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate.md)\
[XGameStreamingUnregisterConnectionStateChanged](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreamingunregisterconnectionstatechanged.md)\
[XGameStreamingRegisterConnectionStateChanged](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged.md)\
[XGameStreaming](https://docs.xbox.com/reference/system/xgamestreaming/xgamestreaming_members.md)


## Related topics

- [XGameStreamingUnregisterConnectionStateChanged](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreamingunregisterconnectionstatechanged.md)
- [XGameStreamingRegisterConnectionStateChanged](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged.md)
- [XGameStreaming (API contents)](https://docs.xbox.com/reference/system/xgamestreaming/xgamestreaming_members.md)
- [XGameStreamingUnregisterClientPropertiesChanged](https://docs.xbox.com/reference/system/xgamestreaming/functions/xgamestreamingunregisterclientpropertieschanged.md)
- [XGameStreamingConnectionState](https://docs.xbox.com/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate.md)
