Skip to main content

Class Peer

Controls flow of data in/out of mirage, Uses

Inheritance
System.Object
Inherited Members
Show
Syntax
public sealed class Peer : IPeer

Constructors

Peer(ISocket, Int32, IDataHandler, Config, ILogger, Metrics)

Declaration
public Peer(ISocket socket, int maxPacketSize, IDataHandler dataHandler, Config config = null, ILogger logger = null, Metrics metrics = null)
Parameters
TypeNameDescription
Mirage.SocketLayer.ISocketsocket
System.Int32maxPacketSize
Mirage.SocketLayer.IDataHandlerdataHandler
Mirage.SocketLayer.Configconfig
ILoggerlogger
Mirage.SocketLayer.Metricsmetrics

Properties

PoolMetrics

Declaration
public PoolMetrics PoolMetrics { get; }

Methods

Bind(IEndPoint)

Declaration
public void Bind(IEndPoint endPoint)
Parameters
TypeNameDescription
Mirage.SocketLayer.IEndPointendPoint

Connect(IEndPoint)

Declaration
public IConnection Connect(IEndPoint endPoint)
Parameters
TypeNameDescription
Mirage.SocketLayer.IEndPointendPoint
Returns
TypeDescription
Mirage.SocketLayer.IConnection

Close()

Declaration
public void Close()

UpdateReceive()

Call this at the start of the frame to receive new messages

Declaration
public void UpdateReceive()

UpdateSent()

Call this at end of frame to send new batches

Declaration
public void UpdateSent()