Skip to main content

XGameStreamingRegisterConnectionStateChanged

Registers a callback to be invoked when a streaming client device’s connection state changes. Upon registration, the callback will be invoked for all streaming client devices that are already connected.

Syntax

Parameters

queue   _In_opt_
Type: XTaskQueueHandle
Handle to the asynchronous queue to put the change callback on. context   _In_opt_
Type: void*
An optional pointer to the context passed to the callback function. callback   _In_
Type: XGameStreamingConnectionStateChangedCallback*
The callback function that will be invoked when any streaming client device’s connection state changes. token   _Out_
Type: XTaskQueueRegistrationToken*
A pointer to the registration token which can be used to unregister from the event.

Return value

Type: HRESULT Returns S_OK if successful; otherwise, returns an error code.

Potential Errors

For a list of error codes, see Error Codes.

Remarks

This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
This API is the recommended way to have the game do customization per streaming client device and maintain state that allows the game to optimize the experience based on whether there are any devices connected.
Upon registration, the callback will be invoked for all streaming client devices that are currently connected.

Example

Requirements

Header: xgamestreaming.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

Conceptual documentation

See also

XGameStreamingConnectionState
XGameStreamingConnectionStateChangedCallback
XGameStreamingUnregisterConnectionStateChanged
XGameStreaming
Last modified on August 20, 2026