Expand description
Our protocol for message size is similar to WebSockets, but not exactly the same.
If the first byte is 0-253, this is the length of the message content.
If the first byte is 254, read the next 2 bytes, this 16 bit number is the length.
If the first byte is 255, read the next 8 bytes, this 64 bit number is the length.
Structs§
- Client
Message - A message recieved from a client
- Write
Function - Use this to write messages back to the server.
Enums§
- Message
- All events that can come from a client/server.
Functions§
- connect_
to_ tcp - Connect to TCP on a given address.
- decode_
message - Decodes a binary message, which was encoded on the other side. May return an error if the data is invalid.
- encode_
message - Encodes a binary message so it can be read on the other side.
- listen_
to_ tcp - Listens for TCP on given address asynchronously.