Stormancer.Networking.ITransport Interface Reference

A Stormancer network transport More...

Inherited by Stormancer.Networking.RakNetTransport.

Public Member Functions

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

Properties

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

Detailed Description

A Stormancer network transport

Member Function Documentation

◆ Connect() [1/2]

Task<IConnection> Stormancer.Networking.ITransport.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

Implemented in Stormancer.Networking.RakNetTransport.

◆ Connect() [2/2]

Task<IConnection> Stormancer.Networking.ITransport.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

Implemented in Stormancer.Networking.RakNetTransport.

◆ Start()

Task Stormancer.Networking.ITransport.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.

Implemented in Stormancer.Networking.RakNetTransport.

Property Documentation

◆ ConnectionOpened

Action<IConnection> Stormancer.Networking.ITransport.ConnectionOpened
getset

Fires when a remote peer has opened a connection.

◆ IsRunning

bool Stormancer.Networking.ITransport.IsRunning
get

Gets a boolean indicating if the transport is currently running.

◆ Name

string Stormancer.Networking.ITransport.Name
get

The name of the transport.

◆ PacketReceived

Action<Packet> Stormancer.Networking.ITransport.PacketReceived
getset

Fires when the transport recieves new packets.


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