Метод | Описание | |
---|---|---|
BinarySerializationProtocol ( ) : System |
Creates a new instance of BinarySerializationProtocol.
|
|
CreateMessages ( byte receivedBytes ) : IEnumerable |
Builds messages from a byte array that is received from remote application. The Byte array may contain just a part of a message, the protocol must cumulate bytes to build messages. This method is synchronized. So, only one thread can call it concurrently.
|
|
Dispose ( ) : void | ||
GetBytes ( IScsMessage message ) : byte[] |
Serializes a message to a byte array to send to remote application. This method is synchronized. So, only one thread can call it concurrently.
|
|
Reset ( ) : void |
This method is called when connection with remote application is reset (connection is renewing or first connecting). So, wire protocol must reset itself.
|
Метод | Описание | |
---|---|---|
DeserializeMessage ( byte bytes ) : IScsMessage |
This method is used to deserialize a IScsMessage from it's bytes. This method can be overrided by derived Classs to change deserialization strategy. It is a couple with SerializeMessage method and must be overrided together.
|
|
Dispose ( bool disposing ) : void | ||
SerializeMessage ( IScsMessage message ) : byte[] |
This method is used to serialize a IScsMessage to a byte array. This method can be overrided by derived Classs to change serialization strategy. It is a couple with DeserializeMessage method and must be overrided together.
|
Метод | Описание | |
---|---|---|
ReadByteArray ( Stream stream, int length ) : byte[] |
Reads a byte array with specified length.
|
|
ReadSingleMessage ( ICollection |
This method tries to read a single message and add to the messages collection.
|
|
WriteInt32 ( byte buffer, int startIndex, int number ) : void |
Writes a int value to a byte array from a starting index.
|
public BinarySerializationProtocol ( ) : System | ||
Результат | System |
public CreateMessages ( byte receivedBytes ) : IEnumerable |
||
receivedBytes | byte | Received bytes from remote application |
Результат | IEnumerable |
protected DeserializeMessage ( byte bytes ) : IScsMessage | ||
bytes | byte | /// Bytes of message to be deserialized (does not include message length. It consist of a /// single whole message) /// |
Результат | IScsMessage |
protected Dispose ( bool disposing ) : void | ||
disposing | bool | |
Результат | void |
public GetBytes ( IScsMessage message ) : byte[] | ||
message | IScsMessage | Message to be serialized |
Результат | byte[] |
protected SerializeMessage ( IScsMessage message ) : byte[] | ||
message | IScsMessage | Message to be serialized |
Результат | byte[] |