The problem
I wanted to understand what a chat library is actually doing, so I wrote the parts myself: connection handling, message framing and ordering.
What I built
Built on raw sockets with a small framing protocol, because the point was to learn where the hard parts are. They turn out to be partial reads and disconnect detection, not the messaging itself.
Architecture
Python sockets with threaded connection handling.
Problems worth writing down
Partial reads
A message could arrive split across two reads. Length prefixed framing made the boundary explicit.