finds.dev← search

// the find

antirez/smallchat

★ 7,508 · C · updated Jan 2024

A minimal programming example for a chat server

A minimal C chat server written by antirez (Redis creator) as a teaching tool for system programming concepts — multiplexing, fan-out, client state. It's paired with a YouTube series walking through each evolution step. This is for developers who want to learn how a real-time server works from first principles, not for anyone building production software.

The code is genuinely small — you can read the whole server in one sitting and understand every line. It uses select(2) correctly and demonstrates non-blocking I/O multiplexing without hiding the mechanics behind a library. Having both a server and a proper terminal-handling client in the same repo gives you the full picture of how these two sides talk. antirez's explanatory style in the README sets honest expectations about what corners are cut and why.

The 'kernel buffer trick' for line reading — assuming each recv() returns a full line — is explicitly acknowledged as a cheat, and it will silently corrupt messages under any real network load. Development appears to have stalled in early 2024 with the planned features (channels, encryption, better multiplexing) never materialized. The video series dependency means the repo evolution is tied to external content that may not continue. There's no test suite of any kind, which is fine for a demo but means you can't meaningfully extend it without breakage risk.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →