Skip to main content

ClientPacketReceiver

A class in Root.Township, Alta.Networking.

The client's packet receiver: creates or approves the server connection when the transport approves it, and passes incoming packets to that connection. Created by Socket on the client.

Constructors​

MemberWhat it is
ClientPacketReceiver(ISocket socket)Creates a ClientPacketReceiver from socket.

Fields​

1 private and internal field
MemberWhat it is
private static readonly Logger loggerNLog logger for this class.

Properties​

1 private and internal property
MemberWhat it is
private ISocket Socket { get; }The socket this receiver works for.

Methods​

MemberWhat it is
void ReceivePackets()Asks the transport to process incoming data, which calls Process for each packet.
3 private and internal methods
MemberWhat it is
private void CreateConnection(ITransportClient client)On transport approval, approves the existing connection or creates and approves a new one.
private void DestroyConnection(ITransportClient client)On transport disconnect, disconnects the matching connection, or logs an error if there is none.
private void Alta.NetworkingTransport.IPacketProcessor.Process(ITransportSocket socket, int connectionId, ArraySegment<byte> data, int channel)Hands a received packet to the connection with that id, skipping empty packets.