How ansanjay/unix-domain-mux-state-machine works
This is a UNIX-domain socket client/server example: a client sends integers, and a select()-driven server tracks multiple clients, accumulates each client’s values, and returns its total when it receives zero. The graph separates client interaction, server multiplexing, and per-client state. Relationships reflect the README and sampled C excerpts; helpers and protocol constants are kept at their actual source paths.
Main entry points: client.c Client Interaction · server.c Select Loop
Components 7
Client
- Client Interaction
client.c
Server
- Socket Listener
server.c - Select Loop
server.c - FD Registry
server.c
Client State
- Client Data Handler
server.c - Per-Client Totals
server.c
Other components
- Terminal User
Connections 10
- Terminal User → Client Interaction: enters values
client.c - Client Interaction → Socket Listener: connects socket
README.md - Socket Listener → Select Loop: registers listener
server.c - Select Loop → FD Registry: refreshes descriptors
server.c - Select Loop → Socket Listener: accepts connections
server.c - Select Loop → Client Data Handler: dispatches ready client
server.c - Client Interaction → Client Data Handler: sends integers
README.md - Client Data Handler → Per-Client Totals: updates total
server.c - Client Data Handler → Client Interaction: returns total
README.md - Client Interaction → Terminal User: displays result
client.c