Interface IPeerListener
Implements a peer listener.
Namespace: SuperNet.Netcode.Transport
Assembly: cs.temp.dll.dll
Syntax
public interface IPeerListener
Methods
OnPeerConnect(Peer)
Called when a peer successfully connects.
Declaration
void OnPeerConnect(Peer peer)
Parameters
Type | Name | Description |
---|---|---|
Peer | peer | Connected peer. |
OnPeerDisconnect(Peer, Reader, DisconnectReason, Exception)
Called when a peer disconnects.
Declaration
void OnPeerDisconnect(Peer peer, Reader reader, DisconnectReason reason, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Peer | peer | Disconnected peer. |
Reader | reader | Disconnect message or null if not included. |
DisconnectReason | reason | Disconnect reason. |
Exception | exception | Exception associated with the disconnect or null if none. |
OnPeerException(Peer, Exception)
Called when an exception occurs internally. Can be ignored.
Declaration
void OnPeerException(Peer peer, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Peer | peer | Peer involved. |
Exception | exception | Exception that was thrown. |
OnPeerReceive(Peer, Reader, MessageReceived)
Called when a peer receives a connected message.
Declaration
void OnPeerReceive(Peer peer, Reader reader, MessageReceived info)
Parameters
Type | Name | Description |
---|---|---|
Peer | peer | Receiver of the message. |
Reader | reader | Message that was received. |
MessageReceived | info | Extra message information. |
OnPeerUpdateRTT(Peer, UInt16)
Called when round trip time (ping) is updated.
Declaration
void OnPeerUpdateRTT(Peer peer, ushort rtt)
Parameters
Type | Name | Description |
---|---|---|
Peer | peer | Updated peer. |
System.UInt16 | rtt | New RTT value. |