
Handle Multiple Clients with select
Build a single-threaded C echo server that serves many clients with select, fd_set, FD_SET and FD_ISSET, and learn why you rebuild the set on every loop.
Everything you need to level up your coding skills.

Build a single-threaded C echo server that serves many clients with select, fd_set, FD_SET and FD_ISSET, and learn why you rebuild the set on every loop.

Switch a socket to non-blocking mode with fcntl and O_NONBLOCK, or set it atomically with SOCK_NONBLOCK and accept4, and learn the flag mistakes that bite.

Learn what blocking and non-blocking I/O mean for sockets on POSIX, what EAGAIN tells you, and why servers with many clients switch to non-blocking mode.

Choose between TCP and UDP for systems code by weighing reliability, ordering, latency and framing, with a decision table and the cost of each option.

Resolve hostnames in C with getaddrinfo, walk the result list, connect to the first address that works, and free it with freeaddrinfo on Linux.

Write a UDP server and client in C with sendto and recvfrom on Linux, and learn why datagrams keep their boundaries but can be lost.

Write a TCP client in C that calls socket and connect, sends a request, reads the reply until the server closes, and handles errors on Linux.

Build a TCP echo server in C with socket, bind, listen and accept, handle one client at a time, and check every error on Linux.

Build a TCP echo server with Tokio's TcpListener, spawn one task per connection and copy bytes back, then test it with a client over loopback.

Build a complete Linux 6.12 network driver for a ring-based PCIe NIC: rings, NAPI, DMA, statistics, ethtool, link state, offloads and recovery.

A socket is a file descriptor for one end of a network conversation. Learn addresses, ports and the Berkeley sockets calls in C on Linux.

Build network protocol parsers and a small TCP/IP stack in C: framing, bounds-safe parsing, state machines, packet buffers, testing, fuzzing and limits.
We send one email when a new post is published. No spam.