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

# XblMultiplayerManagerGameSessionSetSynchronizedHost

> XblMultiplayerManagerGameSessionSetSynchronizedHost

# XblMultiplayerManagerGameSessionSetSynchronizedHost

Sets the host for the game session, using `XblMultiplayerSessionWriteMode::SynchronizedUpdate`.

## Syntax

```cpp theme={null}
HRESULT XblMultiplayerManagerGameSessionSetSynchronizedHost(  
         const char* deviceToken,  
         void* context  
)  
```

### Parameters

*deviceToken*   \_In\_\
Type: char\*

The device token of the host.

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

Optional. The application-defined data to correlate the [XblMultiplayerEvent](/reference/live/xsapi-c/multiplayer_manager_c/structs/xblmultiplayerevent) to the initiating call.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Remarks

This function sets the host for the game session. Use this function to ensure atomicity and resolve any conflicts between devices trying to set the host at the same time. <br />The service may reject the request to set the host if a race condition occurs due to a conflict. If the request is rejected, the service returns `HTTP_E_STATUS_PRECOND_FAILED`. If a conflict occurs, re-evaluate the need to change the host and, if needed, call this function again to re-submit the request.  <br />The result of this function is delivered as a multiplayer event with an event type set to `XblMultiplayerEventType::SynchronizedHostWriteCompleted`. You can call [XblMultiplayerManagerDoWork](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerdowork) to retrieve multiplayer events.  Note that host device tokens are generated from a session member's secure device address, so ensure that the secure device address is set for the desired host prior to calling this method.

## Requirements

**Header:** multiplayer\_manager\_c.h

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

## See also

[multiplayer\_manager\_c](/reference/live/xsapi-c/multiplayer_manager_c/multiplayer_manager_c_members)\
[XblMultiplayerManagerGameSessionSetSynchronizedProperties](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagergamesessionsetsynchronizedproperties)\
[XblMultiplayerEvent](/reference/live/xsapi-c/multiplayer_manager_c/structs/xblmultiplayerevent)\
[XblMultiplayerManagerLobbySessionSetLocalMemberConnectionAddress](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerlobbysessionsetlocalmemberconnectionaddress)


## Related topics

- [XblMultiplayerManagerGameSessionSetSynchronizedProperties](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagergamesessionsetsynchronizedproperties.md)
- [XblMultiplayerManagerGameSessionIsHost](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagergamesessionishost.md)
- [XblMultiplayerManagerGameSessionSetProperties](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagergamesessionsetproperties.md)
- [XblMultiplayerManagerLobbySessionSetLocalMemberProperties](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerlobbysessionsetlocalmemberproperties.md)
- [Multiplayer Manager API overview](/services/xbox-services/multiplayer/mpm/concepts/live-multiplayer-manager-api-overview.md)
