Edit

Share via


MultiplayerService.GetCurrentSessionAsync(MultiplayerSessionReference) Method

Definition

Gets a session object, with all of its attributes, from the server.

public Windows.Foundation.IAsyncOperation<Microsoft.Xbox.Services.Multiplayer.MultiplayerSession> GetCurrentSessionAsync (Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionReference sessionReference);
abstract member GetCurrentSessionAsync : Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionReference -> Windows.Foundation.IAsyncOperation<Microsoft.Xbox.Services.Multiplayer.MultiplayerSession>
override this.GetCurrentSessionAsync : Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionReference -> Windows.Foundation.IAsyncOperation<Microsoft.Xbox.Services.Multiplayer.MultiplayerSession>
Public Function GetCurrentSessionAsync (sessionReference As MultiplayerSessionReference) As IAsyncOperation(Of MultiplayerSession)

Parameters

sessionReference
MultiplayerSessionReference

A MultiplayerSessionReference object that contains identifying information for the session.

Returns

Windows.Foundation.IAsyncOperation<MultiplayerSession>

Returns an IAsyncOperation<TResult> object that represents the state of the asynchronous operation. Completion of the asynchronous operation is signaled by using a handler that is passed to the IAsyncOperation<TResult>.Completed property. When the asynchronous operation is complete, the result of the operation can be retrieved by using the IAsyncOperation<TResult>.GetResults method.

The result is a MultiplayerSession object containing the response returned from the server.

Implements

Microsoft.Xbox.Services.Multiplayer.__IMultiplayerServicePublicNonVirtuals.GetCurrentSessionAsync(Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionReference)

Remarks

If the client tries to get a session that does not exist, this method returns an HTTP/204 status code. Additionally an exception is thrown for trying to retrieve a nonexistent session.

Calls V102 GET /serviceconfigs/{serviceConfigurationId}/sessionTemplates/{sessiontemplateName}/sessions/{sessionName}

Applies to