BinarySerializationProtocol |
Default communication protocol between server and clients to send and receive a message. It uses .NET binary serialization to write and read messages. A Message format: [Message Length (4 bytes)][Serialized Message Content] If a message is serialized to byte array as N bytes, this protocol adds 4 bytes size information to head of the message bytes, so total length is (4 + N) bytes. This class can be derived to change serializer (default: BinaryFormatter). To do this, SerializeMessage and DeserializeMessage methods must be overrided. |