MxClient

class MxClient : System.Object

A client on the Mx protocol.

readonly System.Net.IPEndPoint Endpoint

Gets the endpoint that this client is responsible for.

Value:The endpoint that this client is responsible for.
readonly float Latency

Gets the amount of network latency (lag) in milliseconds.

Value:The network latency.
Protogame.MxClientGroup Group

The group that this Mx client is in. You should not set this directly; instead call M:Protogame.MxDispatcher.PlaceInGroup(Protogame.MxClient,System.String).

int DisconnectLimit

The disconnection timeout limit.

int DisconnectWarningLimit

The disconnection timeout warning limit.

readonly int DisconnectAccumulator

The disconnection accumulator.

readonly bool HasReceivedPacket

Whether or not this client has ever received a packet. When a group is isolating connections via M:Protogame.MxClientGroup.Isolate, it checks this value to see whether or not the client has had successful communications as opposed to simply not having timed out yet.

public void add_DisconnectWarning(MxDisconnectEventHandler value)
Parameters:
  • value (Protogame.MxDisconnectEventHandler) –
public void remove_DisconnectWarning(MxDisconnectEventHandler value)
Parameters:
  • value (Protogame.MxDisconnectEventHandler) –
public void add_FlowControlChanged(FlowControlChangedEventHandler value)
Parameters:
  • value (Protogame.FlowControlChangedEventHandler) –
public void remove_FlowControlChanged(FlowControlChangedEventHandler value)
Parameters:
  • value (Protogame.FlowControlChangedEventHandler) –
public void add_MessageAcknowledged(MxMessageEventHandler value)
Parameters:
  • value (Protogame.MxMessageEventHandler) –
public void remove_MessageAcknowledged(MxMessageEventHandler value)
Parameters:
  • value (Protogame.MxMessageEventHandler) –
public void add_MessageLost(MxMessageEventHandler value)
Parameters:
  • value (Protogame.MxMessageEventHandler) –
public void remove_MessageLost(MxMessageEventHandler value)
Parameters:
  • value (Protogame.MxMessageEventHandler) –
public void add_MessageReceived(MxMessageReceiveEventHandler value)
Parameters:
  • value (Protogame.MxMessageReceiveEventHandler) –
public void remove_MessageReceived(MxMessageReceiveEventHandler value)
Parameters:
  • value (Protogame.MxMessageReceiveEventHandler) –
public void add_MessageSent(MxMessageEventHandler value)
Parameters:
  • value (Protogame.MxMessageEventHandler) –
public void remove_MessageSent(MxMessageEventHandler value)
Parameters:
  • value (Protogame.MxMessageEventHandler) –
public void EnqueueReceive(System.Byte[] packet)

Enqueues a byte array to be handled in the receiving logic when Update() is called.

Parameters:
  • packet (System.Byte[]) – The packet’s byte data.
public void EnqueueSend(System.Byte[] packet, uint protocol)

Enqueues a byte array to be sent to the target endpoint when Update() is called.

Parameters:
  • packet (System.Byte[]) – The packet’s byte data.
  • protocol (uint) – The packet’s protocol type.
public void Update()

Updates the state of the Mx client, sending outgoing packets and receiving incoming packets.