Stormancer.Networking.IConnectionManager Interface Reference

Manages connections More...

Inherited by Stormancer.ConnectionRepository.

Public Member Functions

Task< IConnectionAddPendingConnection (ulong id)
 
void NewConnection (IConnection connection)
 Adds a connection to the manager More...
 
void CloseConnection (IConnection connection, string reason)
 Closes the target connection. More...
 
IConnection GetConnection (ulong id)
 Returns a connection by id. Returns null if the connection is not completed More...
 
IConnection GetConnection (string id)
 Returns a connection by id. Returns null if the connection is not completed More...
 
Task< IConnectionGetConnection (string id, Func< string, Task< IConnection >> connectionFactory)
 Returns a connection by id, of create a new if not already created More...
 
int GetConnectionCount ()
 Returns the connection count More...
 
void CloseAllConnections (string reason)
 Close All Connections More...
 
void SetTimeout (TimeSpan timeout, CancellationToken ct)
 Set a timeout duration on all the current open connections More...
 

Detailed Description

Manages connections

Member Function Documentation

◆ CloseAllConnections()

void Stormancer.Networking.IConnectionManager.CloseAllConnections ( string  reason)

Close All Connections

Parameters
reasonThe reason of the closure.
Returns

Implemented in Stormancer.ConnectionRepository.

◆ CloseConnection()

void Stormancer.Networking.IConnectionManager.CloseConnection ( IConnection  connection,
string  reason 
)

Closes the target connection.

Parameters
connectionThe connection to close.
reasonThe reason of the closure.

Implemented in Stormancer.ConnectionRepository.

◆ GetConnection() [1/3]

IConnection Stormancer.Networking.IConnectionManager.GetConnection ( string  id)

Returns a connection by id. Returns null if the connection is not completed

Parameters
idThe connection Id
Returns

Implemented in Stormancer.ConnectionRepository.

◆ GetConnection() [2/3]

Task<IConnection> Stormancer.Networking.IConnectionManager.GetConnection ( string  id,
Func< string, Task< IConnection >>  connectionFactory 
)

Returns a connection by id, of create a new if not already created

Parameters
idThe connection Id
connectionFactoryA factory to create a new connection if not existing
Returns

Implemented in Stormancer.ConnectionRepository.

◆ GetConnection() [3/3]

IConnection Stormancer.Networking.IConnectionManager.GetConnection ( ulong  id)

Returns a connection by id. Returns null if the connection is not completed

Parameters
idThe connection Id
Returns

Implemented in Stormancer.ConnectionRepository.

◆ GetConnectionCount()

int Stormancer.Networking.IConnectionManager.GetConnectionCount ( )

Returns the connection count

Returns

Implemented in Stormancer.ConnectionRepository.

◆ NewConnection()

void Stormancer.Networking.IConnectionManager.NewConnection ( IConnection  connection)

Adds a connection to the manager

Parameters
connectionThe connection object to add.

This method is called by the infrastructure when a new connection connects to a transport.

Implemented in Stormancer.ConnectionRepository.

◆ SetTimeout()

void Stormancer.Networking.IConnectionManager.SetTimeout ( TimeSpan  timeout,
CancellationToken  ct 
)

Set a timeout duration on all the current open connections

Parameters
timeoutThe timeout duration.
ct
Returns

Implemented in Stormancer.ConnectionRepository.


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