Interface IHostListener
Implements a host listener.
Namespace: SuperNet.Netcode.Transport
Assembly: cs.temp.dll.dll
Syntax
public interface IHostListener
Methods
OnHostException(IPEndPoint, Exception)
Called when an exception occurs internally.
This does not usually indicate any fatal errors and can be ignored.
Declaration
void OnHostException(IPEndPoint remote, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | remote | Remote address associated with this exception or null. |
Exception | exception | Exception that was thrown. |
OnHostReceiveBroadcast(IPEndPoint, Reader)
Called for every broadcast message the host receives.
Declaration
void OnHostReceiveBroadcast(IPEndPoint remote, Reader message)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | remote | Remote address message was received from. |
Reader | message | Message that was received. |
OnHostReceiveRequest(ConnectionRequest, Reader)
Called when a connection request is received.
The request can only be accepted during this call.
Declaration
void OnHostReceiveRequest(ConnectionRequest request, Reader message)
Parameters
Type | Name | Description |
---|---|---|
ConnectionRequest | request | Connection request received. |
Reader | message | Message sent with the connection request. |
OnHostReceiveSocket(IPEndPoint, Byte[], Int32)
Called for every raw packet the host receives.
Declaration
void OnHostReceiveSocket(IPEndPoint remote, byte[] buffer, int length)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | remote | Remote address packet was received from. |
System.Byte[] | buffer | Receive buffer the packet is written on. |
System.Int32 | length | Number of bytes in the packet. |
OnHostReceiveUnconnected(IPEndPoint, Reader)
Called for every unconnected message the host receives.
Declaration
void OnHostReceiveUnconnected(IPEndPoint remote, Reader message)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | remote | Remote address message was received from. |
Reader | message | Message that was received. |
OnHostShutdown()
Called when the host shuts down.
Declaration
void OnHostShutdown()