Transport
MultiTransport
Several transports behind one ITransport, so the gateway accepts native clients over UDP and browsers over WebRTC without caring which link a peer arrived on.
generated from the sources
Class in namespace
Nebula · Packages/com.1by3.nebula/Runtime/Transport/MultiTransport.cspublic sealed class MultiTransport : ITransport, ISecureTransportSeveral transports behind one ITransport, so the gateway accepts native clients over UDP and browsers over WebRTC without caring which link a peer arrived on. The first transport is the primary: Listen, StartClient and Connect go to it, and the others accept on ports of their own that were opened before they were added. A peer id is the inner id times the number of transports plus the transport's index.
Constructors
MultiTransport
public MultiTransport(params ITransport[] transports);Properties
Name
public string Name { get; }IsRunning
public bool IsRunning { get; }LocalPort
public int LocalPort { get; }SecurityError
public string SecurityError { get; }Methods
Listen
public void Listen(int port);StartClient
public void StartClient();Connect
public int Connect(string host, int port);IsEncrypted
public bool IsEncrypted(int peerId);Returns the peer's encryption status from its underlying ISecureTransport, or false when that interface is unavailable.
Disconnect
public void Disconnect(int peerId);IsConnected
public bool IsConnected(int peerId);RoundTripMs
public int RoundTripMs(int peerId);Send
public void Send(int peerId, Delivery delivery, ArraySegment<byte> payload);Poll
public void Poll(Action<TransportEvent> handler);Flush
public void Flush();Stop
public void Stop();Dispose
public void Dispose();