Stormancer.Networking.RakNetTransport Class Reference

Inherits Stormancer.Networking.ITransport.

Public Member Functions

 RakNetTransport (IDependencyResolver resolver)
 
Task Start (string type, IConnectionManager handler, CancellationToken token, ushort? serverPort, ushort maxConnections, AddressType addressType=AddressType.Undefined)
 Starts the transport More...
 
async Task< IConnectionConnect (string endpoint, string id, string parentId)
 Connects the transport to a remote host. More...
 
async Task< IConnectionConnect (string endpoint, string id, string parentId, CancellationToken ct)
 Connects the transport to a remote host. More...
 
void Stop ()
 
List< string > GetAvailableEndpoints ()
 
async Task< int > SendPing (string address, int number, CancellationToken cancellationToken)
 
async Task< int > SendPing (string address, CancellationToken cancellationToken)
 
async Task< int > SendPing (string address)
 
async Task< int > SendPing (string address, int number)
 
void OpenNat (string address)
 

Properties

Action< Stormancer.Core.PacketPacketReceived [get, set]
 
Action< IConnectionConnectionOpened [get, set]
 
string Name [get]
 
bool IsRunning [get]
 
- Properties inherited from Stormancer.Networking.ITransport
bool IsRunning [get]
 Gets a boolean indicating if the transport is currently running. More...
 
Action< PacketPacketReceived [get, set]
 Fires when the transport recieves new packets. More...
 
Action< IConnectionConnectionOpened [get, set]
 Fires when a remote peer has opened a connection. More...
 
string Name [get]
 The name of the transport. More...
 

Member Function Documentation

◆ Connect() [1/2]

async Task<IConnection> Stormancer.Networking.RakNetTransport.Connect ( string  endpoint,
string  id,
string  parentId 
)

Connects the transport to a remote host.

Parameters
endpointa string containing the target endpoint the expected format is host:port
Returns
A Task<IConnection> object completing with the connection process and returning the corresponding IConnection

Implements Stormancer.Networking.ITransport.

◆ Connect() [2/2]

async Task<IConnection> Stormancer.Networking.RakNetTransport.Connect ( string  endpoint,
string  id,
string  parentId,
CancellationToken  ct 
)

Connects the transport to a remote host.

Parameters
endpointa string containing the target endpoint the expected format is host:port
Returns
A Task<IConnection> object completing with the connection process and returning the corresponding IConnection

Implements Stormancer.Networking.ITransport.

◆ Start()

Task Stormancer.Networking.RakNetTransport.Start ( string  type,
IConnectionManager  handler,
CancellationToken  token,
ushort?  port,
ushort  maxConnections,
AddressType  addressType = AddressType.Undefined 
)

Starts the transport

Parameters
handlerThe connection handler used by the connection.
tokenA CancellationToken. It will be cancelled when the transport has to be shutdown.
porta ushort? indicating on which port the transport should listen if it is started as a server. null if it's a client.
maxConnectionsThe maximum number of simultaneous connections this transport can connect too. On clients, this restricts the number of P2P peers.
Returns
A Task completing when the transport is started.

Only server compatible transports support the port parameter.

Implements Stormancer.Networking.ITransport.


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