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

# XGameStreamingUnregisterConnectionStateChanged

> XGameStreamingUnregisterConnectionStateChanged

# XGameStreamingUnregisterConnectionStateChanged

Unregisters a previously registered [XGameStreamingConnectionStateChangedCallback](/reference/system/xgamestreaming/functions/xgamestreamingconnectionstatechangedcallback).

## Syntax

```cpp theme={null}
bool XGameStreamingUnregisterConnectionStateChanged(
         XTaskQueueRegistrationToken token,
         bool wait
)
```

### Parameters

*token*   \_In\_
Type: XTaskQueueRegistrationToken

Token that corresponded to the callback registration done via [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged).

*wait*   \
Type: bool

If `wait` is set to true, `XGameStreamingUnregisterConnectionStateChanged` will not return until both the registration has been revoked and any outstanding callbacks have completed.

If `wait` is set to false, `XGameStreamingUnregisterConnectionStateChanged` will return as soon as the registration has been revoked. Although no new callbacks will be delivered, an in progress callback may still be executing when the function returns.

### Return value

Type: bool

Returns true if the unregistration was successful, false if it did not succeed.

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

This API can be used to stop listening to streaming client device's connection changes.

This should be done when the game is either going to only do a broad check of whether any clients are streaming by utilizing [XGameStreamingIsStreaming](/reference/system/xgamestreaming/functions/xgamestreamingisstreaming), or is no longer going to do any optimizing of the experience due to streaming clients.

## Requirements

**Header:** xgamestreaming.h

**Library:** xgameruntime.lib

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

## Conceptual documentation

* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[XGameStreamingConnectionStateChangedCallback](/reference/system/xgamestreaming/functions/xgamestreamingconnectionstatechangedcallback)\
[XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged)\
[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members)


## Related topics

- [XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged.md)
- [XGameStreamingConnectionStateChangedCallback](/reference/system/xgamestreaming/functions/xgamestreamingconnectionstatechangedcallback.md)
- [XGameStreamingConnectionState](/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate.md)
- [XGameStreamingIsStreaming](/reference/system/xgamestreaming/functions/xgamestreamingisstreaming.md)
- [XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members.md)
