Stormancer.Client Class Reference

Stormancer client library More...

Inherits IDisposable.

Public Member Functions

 Client (ClientConfiguration configuration)
 Creates a Stormancer client instance. More...
 
async Task< SceneGetPublicScene (string sceneId, CancellationToken cancellationToken=default(CancellationToken))
 Returns a public scene (accessible without authentication) More...
 
async Task< SceneGetConnectedScene (string sceneId, CancellationToken cancellationToken=default(CancellationToken))
 
void SetServerTimeout (TimeSpan timeout, CancellationToken ct)
 
async Task< SceneGetPrivateScene (string sceneToken, CancellationToken cancellationToken=default(CancellationToken))
 Returns a private scene (requires a token obtained from strong authentication with the Stormancer API. More...
 
async Task< SceneConnectToPublicScene (string sceneId, Action< Scene > sceneInitializer=null, CancellationToken cancellationToken=default(CancellationToken))
 
async Task< SceneConnectToPrivateScene (string sceneToken, Action< Scene > initializer, CancellationToken cancellationToken=default(CancellationToken))
 
async Task Disconnect (IConnection connection, byte sceneHandle, bool initiatedByServer, string reason)
 
async Task Disconnect (string sceneId, bool initiatedByServer, string reason="")
 
async Task Disconnect (Scene scene, bool initiatedByServer=false, string reason="")
 
void Disconnect ()
 Disconnects the client. More...
 
void Dispose ()
 Disposes the client object. More...
 
IConnectionStatistics GetServerConnectionStatistics ()
 Returns statistics about the connection to the server. More...
 

Properties

AddressType AddressType = AddressType.NotYetDefined [get, set]
 
string ApplicationName [get]
 The name of the Stormancer server application the client is connected to. More...
 
StormancerResolver DependencyResolver [get]
 
ILogger Logger [get]
 
long Clock [get]
 Synchronized clock with the server. More...
 
long LastPing [get]
 Last ping value with the cluster. More...
 
int ServerPing [get]
 The server connection's ping, in milliseconds. More...
 
string ServerTransportType [get]
 The name of the transport used for connecting to the server. More...
 

Detailed Description

Stormancer client library

Constructor & Destructor Documentation

◆ Client()

Stormancer.Client.Client ( ClientConfiguration  configuration)

Creates a Stormancer client instance.

Parameters
configurationA configuration instance containing options for the client.

Member Function Documentation

◆ Disconnect()

void Stormancer.Client.Disconnect ( )

Disconnects the client.

◆ Dispose()

void Stormancer.Client.Dispose ( )

Disposes the client object.

Calls the Disconnect method to shutdown the transport gracefully.

◆ GetPrivateScene()

async Task<Scene> Stormancer.Client.GetPrivateScene ( string  sceneToken,
CancellationToken  cancellationToken = default(CancellationToken) 
)

Returns a private scene (requires a token obtained from strong authentication with the Stormancer API.

The effective connection happens when "Connect" is called on the scene. Note that when you call GetScene, a connection token is requested from the Stormancer API.this token is only valid for a few minutes: Don't get scenes a long time before connecting to them.

Parameters
tokenThe token securing the connection.
Returns
A task returning the scene object on completion.

◆ GetPublicScene()

async Task<Scene> Stormancer.Client.GetPublicScene ( string  sceneId,
CancellationToken  cancellationToken = default(CancellationToken) 
)

Returns a public scene (accessible without authentication)

The effective connection happens when "Connect" is called on the scene.

Parameters
sceneIdThe id of the scene to connect to.
userDataUser data that should be associated to the connection.
Returns
A task returning the scene

◆ GetServerConnectionStatistics()

IConnectionStatistics Stormancer.Client.GetServerConnectionStatistics ( )

Returns statistics about the connection to the server.

Returns
The required statistics

Property Documentation

◆ ApplicationName

string Stormancer.Client.ApplicationName
get

The name of the Stormancer server application the client is connected to.

◆ Clock

long Stormancer.Client.Clock
get

Synchronized clock with the server.

◆ LastPing

long Stormancer.Client.LastPing
get

Last ping value with the cluster.

0 means that no mesure has be made yet.

◆ ServerPing

int Stormancer.Client.ServerPing
get

The server connection's ping, in milliseconds.

◆ ServerTransportType

string Stormancer.Client.ServerTransportType
get

The name of the transport used for connecting to the server.


The documentation for this class was generated from the following file:
  • Stormancer.Unity/Client.cs