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

# XblMultiplayerAddSessionChangedHandler

> XblMultiplayerAddSessionChangedHandler

# XblMultiplayerAddSessionChangedHandler

Registers an event handler for notifications when a multiplayer session changes. If the RTA subscription has not been explicitly enabled with [XblMultiplayerSetSubscriptionsEnabled](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersetsubscriptionsenabled), adding session changed handlers will enable it automatically. Use the returned XblFunctionContext to unregister the handler.

## Syntax

```cpp theme={null}
XblFunctionContext XblMultiplayerAddSessionChangedHandler(  
         XblContextHandle xblContext,  
         XblMultiplayerSessionChangedHandler* handler,  
         void* context  
)  
```

### Parameters

*xblContext*   \_In\_\
Type: [XblContextHandle](/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

XBOX live context for the local user.

*handler*   \_In\_\
Type: XblMultiplayerSessionChangedHandler\*

The callback function that receives notifications.

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

Caller context to be passed the handler.

### Return value

Type: XblFunctionContext

The function context token that was registered for the event.

## Requirements

**Header:** multiplayer\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[multiplayer\_c](/reference/live/xsapi-c/multiplayer_c/multiplayer_c_members)


## Related topics

- [Multiplayer tasks](/services/xbox-services/multiplayer/mpsd/how-to/live-mpsd-how-tos.md)
- [XblMultiplayerSetSubscriptionsEnabled](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersetsubscriptionsenabled.md)
- [Moving from MPSD to PlayFab Multiplayer and MPA](/services/xbox-services/multiplayer/mpsd/concepts/live-mpsd-to-mlp.md)
- [XblMultiplayerSessionChangedHandler](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersessionchangedhandler.md)
- [XblMultiplayerRemoveSessionChangedHandler](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayerremovesessionchangedhandler.md)
