Options to use. See the ProtocolOptions page
Create a new server instance. Each instance communicates with 1 client.
Options to use. See ProtocolOptions.
First message that was received (contains authentication information)
Gets the authentication message that was passed to createClient. If it returns true the connection is accepted. Can return an instance of ErrorObject to provide the client a reason for tha failure. If not present, all connections are accepted.
Decodes ClientId.
Expects message in format: <1B length><Id of given length><Other data>
Input message
First is the Id, then the other data.
Decode SessionId from Buffer. Reads the first 2B as UInt16 using Little Endian.
Input Buffer
The decoded SessionId and the remaining message.
Encodes ClientId.
Creates the following format: <1B length><Id of given length><Other data>
Client Id in the form of a Buffer. Cannot be longer than 255B.
Remaining data to encode
The encoded Buffer
Encodes SessionId together with the remaining Buffer. Writes UInt16 using Little Endian.
The SessionId to write. Must be in [0, 65535].
Remaining message to encode
Encoded message.
Deserializes a string according to the custom encoding
String to deserialize
Deserialized object
Serializes any object using custom Map and Buffer encoding
Object to be serialized
Serialized object
Generated using TypeDoc
Prepare a new client instance