C# Class SocketLibrary.Packets.PacketProcessor

Show file Open project: Wotuu/RTS_XNA_v2 Class Usage Examples

Public Methods

Method Description
PacketProcessor ( ) : System
QueuePacket ( byte fullData, SocketClient receiver ) : void

SentPacket ( Packet p, SocketClient client ) : void

Called when the packet is sent.

StartProcessing ( ) : void

Spawns a thread to start processing packets

StopProcessing ( ) : void

Kills the thread, making it stop processing packets!

Private Methods

Method Description
BytesToString ( byte data ) : String

Converts a byte array to a string.

ConfirmPacket ( int packetID ) : void

Confirms a packet ID.

ConstructPacket ( byte fullData ) : SocketLibrary.Packets.Packet[]

Constructs a packet from a full byte array.

ProcessQueue ( ) : void
StringToBytes ( String str ) : byte[]

Converts a string to bytes.

Method Details

PacketProcessor() public method

public PacketProcessor ( ) : System
return System

QueuePacket() public method

public QueuePacket ( byte fullData, SocketClient receiver ) : void
fullData byte
receiver SocketClient
return void

SentPacket() public method

Called when the packet is sent.
public SentPacket ( Packet p, SocketClient client ) : void
p Packet The packet that was sent.
client SocketClient
return void

StartProcessing() public method

Spawns a thread to start processing packets
public StartProcessing ( ) : void
return void

StopProcessing() public method

Kills the thread, making it stop processing packets!
public StopProcessing ( ) : void
return void