Tutorials¶
Tutorials are guided learning experiences, split into short, numbered pages you follow in order – each links to the next. The first five build one real thing: the frame format for a tiny chat relay, the kind of protocol a small TCP server might speak. The second five apply the same workflow to formats someone else already designed.
Build a chat relay’s frame format¶
A chat relay forwards short messages between connected clients over TCP. Every message on the wire needs a type tag, a sequence number so drops are detectable, and protection against a corrupted read being mistaken for a valid message. By the end of this sequence you will have defined that frame, packed and decoded it, read it from a socket that delivers bytes in arbitrary chunks, and handled a corrupted frame.