Method | Description | |
---|---|---|
Close ( ) : void |
Closes the dispatcher permanently, terminating all inbound and outbound connections.
|
|
Connect ( |
Explicitly connect to the specified endpoint, assuming there is an Mx dispatcher at the specified address. This method is used to explicitly add clients, not to start the dispatcher. The dispatcher does not require an explicit start.
|
|
Disconnect ( MxClient client ) : void |
Disconnects the specified Mx client. This removes it from the group that owns it, and prevents it from reconnecting to this dispatcher implicitly.
|
|
Disconnect ( MxClientGroup clientGroup ) : void |
Disconnects the entire Mx client group, disconnecting all clients inside it.
|
|
GetBytesLastReceivedAndReset ( ) : int | ||
GetBytesLastSentAndReset ( ) : int | ||
MxDispatcher ( |
Initializes a new instance of the MxDispatcher class.
|
|
MxDispatcher ( int port ) : System |
Initializes a new instance of the MxDispatcher class.
|
|
PlaceInGroup ( MxClient client, string identifier ) : MxClientGroup |
Places the specified Mx client in the specified group.
|
|
Send ( MxClient client, byte packet, bool reliable = false ) : void |
Queue a packet for sending to the specified client.
|
|
Send ( MxClientGroup group, byte packet, bool reliable = false ) : void |
Queue a packet for sending to the specified endpoint.
|
|
Update ( ) : void |
Updates the dispatcher, receiving messages and connecting clients as appropriate.
|
|
this ( string identifier ) : MxClientGroup |
Retrieves the client group for the given identifier.
|
Method | Description | |
---|---|---|
OnClientConnected ( MxClient client ) : void |
Raise the ClientConnected event.
|
|
OnClientDisconnectWarning ( Protogame.MxDisconnectEventArgs e ) : void |
Raise the ClientDisconnectWarning event.
|
|
OnClientDisconnected ( MxClient client ) : void |
Raise the ClientDisconnected event.
|
|
OnMessageAcknowledged ( Protogame.MxMessageEventArgs e ) : void |
Raise the MessageAcknowledged event.
|
|
OnMessageLost ( Protogame.MxMessageEventArgs e ) : void |
Raise the MessageLost event.
|
|
OnMessageReceived ( Protogame.MxMessageEventArgs e ) : void |
Raise the MessageReceived event.
|
|
OnMessageSent ( Protogame.MxMessageEventArgs e ) : void |
Raise the MessageSent event.
|
|
OnReliableReceivedProgress ( Protogame.MxReliabilityTransmitEventArgs e ) : void |
Raise the ReliableReceivedProgress event.
|
|
OnReliableSendProgress ( Protogame.MxReliabilityTransmitEventArgs e ) : void |
Raise the ReliableSendProgress event.
|
Method | Description | |
---|---|---|
AssertNotClosed ( ) : void |
Assert that the dispatcher has not been closed.
|
|
OnClientDisconnectWarning ( object sender, Protogame.MxDisconnectEventArgs e ) : void |
Handle receiving a DisconnectWarning event from a client.
|
|
OnClientMessageAcknowledged ( object sender, Protogame.MxMessageEventArgs e ) : void |
Handle receiving a MessageAcknowledged event from a client.
|
|
OnClientMessageLost ( object sender, Protogame.MxMessageEventArgs e ) : void |
Handle receiving a MessageLost event from a client.
|
|
OnClientMessageReceived ( object sender, Protogame.MxMessageEventArgs e ) : void |
Handle receiving a MessageReceived event from a client.
|
|
OnClientMessageSent ( object sender, Protogame.MxMessageEventArgs e ) : void |
Handle receiving a MessageSent event from a client.
|
|
OnReliabilityFragmentReceived ( object sender, Protogame.MxReliabilityTransmitEventArgs e ) : void |
Handle receiving a FragmentReceived event from a reliability class.
|
|
OnReliabilityFragmentSent ( object sender, Protogame.MxReliabilityTransmitEventArgs e ) : void |
Handle receiving a FragmentSent event from a reliability class.
|
|
OnReliabilityMessageAcknowledged ( object sender, Protogame.MxMessageEventArgs e ) : void |
Handle receiving a MessageAcknowledged event from a reliability class.
|
|
OnReliabilityMessageReceived ( object sender, Protogame.MxMessageEventArgs e ) : void |
Handle receiving a MessageReceived event from a reliability class.
|
|
ReceiveNonBlocking ( |
Receive a message in an non-blocking manner. If there is no message to receive, this function returns null.
|
|
RegisterForEvents ( MxClient client ) : void |
Register for a client's events.
|
|
RegisterForEvents ( |
Register for a reliability's events.
|
|
ThreadSafeGetOrCreateClient ( |
||
UnregisterFromEvents ( MxClient client ) : void |
Unregister from a client's events.
|
|
UnregisterFromEvents ( |
Unregister from a reliability's events.
|
public Connect ( |
||
endpoint | /// The endpoint to connect to. /// | |
return | MxClient |
public Disconnect ( MxClient client ) : void | ||
client | MxClient | The client. |
return | void |
public Disconnect ( MxClientGroup clientGroup ) : void | ||
clientGroup | MxClientGroup | The client group. |
return | void |
public GetBytesLastReceivedAndReset ( ) : int | ||
return | int |
public MxDispatcher ( |
||
client | ||
return | System |
public MxDispatcher ( int port ) : System | ||
port | int | /// The port of the UDP client. /// |
return | System |
protected OnClientConnected ( MxClient client ) : void | ||
client | MxClient | /// The client. /// |
return | void |
protected OnClientDisconnectWarning ( Protogame.MxDisconnectEventArgs e ) : void | ||
e | Protogame.MxDisconnectEventArgs | /// The event arguments. /// |
return | void |
protected OnClientDisconnected ( MxClient client ) : void | ||
client | MxClient | /// The client. /// |
return | void |
protected OnMessageAcknowledged ( Protogame.MxMessageEventArgs e ) : void | ||
e | Protogame.MxMessageEventArgs | /// The event arguments. /// |
return | void |
protected OnMessageLost ( Protogame.MxMessageEventArgs e ) : void | ||
e | Protogame.MxMessageEventArgs | /// The event arguments. /// |
return | void |
protected OnMessageReceived ( Protogame.MxMessageEventArgs e ) : void | ||
e | Protogame.MxMessageEventArgs | /// The event arguments. /// |
return | void |
protected OnMessageSent ( Protogame.MxMessageEventArgs e ) : void | ||
e | Protogame.MxMessageEventArgs | /// The event arguments. /// |
return | void |
protected OnReliableReceivedProgress ( Protogame.MxReliabilityTransmitEventArgs e ) : void | ||
e | Protogame.MxReliabilityTransmitEventArgs | /// The event arguments. /// |
return | void |
protected OnReliableSendProgress ( Protogame.MxReliabilityTransmitEventArgs e ) : void | ||
e | Protogame.MxReliabilityTransmitEventArgs | /// The event arguments. /// |
return | void |
public PlaceInGroup ( MxClient client, string identifier ) : MxClientGroup | ||
client | MxClient | The Mx client. |
identifier | string | The group identifier. |
return | MxClientGroup |
public Send ( MxClient client, byte packet, bool reliable = false ) : void | ||
client | MxClient | /// The client to send the message to. /// |
packet | byte | /// The associated data to send. /// |
reliable | bool | /// Whether or not this message should be sent reliably and intact. This also /// permits messages larger than 512 bytes to be sent. /// |
return | void |
public Send ( MxClientGroup group, byte packet, bool reliable = false ) : void | ||
group | MxClientGroup | /// The group to send the message to. /// |
packet | byte | /// The associated data to send. /// |
reliable | bool | /// Whether or not this message should be sent reliably and intact. This also /// permits messages larger than 512 bytes to be sent. /// |
return | void |
public this ( string identifier ) : MxClientGroup | ||
identifier | string | The identifier for the group. |
return | MxClientGroup |