The ClientPacketProcessor didn't find the right IPacketHandler due to an error in the code. This is now fixed and the packet processing code has been cleaned up (client and server code).
When using ZeroFormatterPacketSerialiser the packet instance of PacketHandlerBase.Process(T packet, ISender sender) is null, this was because the deserialize method was not yet implemented, this is now implemented.
Changes
ClientPacketProcessor:
Ran multiple times do to buffer.Length to large => fixed by changing buffer size to the amount of the received byte.
Packet name not found do to negation of if statement (!this.packetSerialiser.CanReadName => this.packetSerialiser.CanReadName)
Ordered in logical order, to prevent unnecessary calculations.
ServerPacketProcessor:
Ordered code and removed double if statement.
ZeroFormatterPacketSerialiser:
Removed method 'Deserialise(byte[] packetBytes)' due to not used, and not part of abstraction.
Implmemented method 'Deserialise(byte[] packetBytes, int offset, int length)'
I have tested both ZeroFormatter and ProtobufNet applications and everything seems to be working properly.
The ClientPacketProcessor didn't find the right IPacketHandler due to an error in the code. This is now fixed and the packet processing code has been cleaned up (client and server code).
When using ZeroFormatterPacketSerialiser the packet instance of PacketHandlerBase.Process(T packet, ISender sender) is null, this was because the deserialize method was not yet implemented, this is now implemented.
Changes
ClientPacketProcessor:
ServerPacketProcessor:
ZeroFormatterPacketSerialiser:
I have tested both ZeroFormatter and ProtobufNet applications and everything seems to be working properly.