All languages

C

You're viewing a free preview. Sign in free to read every script.

Why this exists The simple way to serve a network client is one thread or process per connection, which stops scaling at thousands of clients. nginx, Redis, HAProxy and Node.js instead use one loop that asks the kernel…

A Tiny TCP Server with epoll: Event-Driven I/O for Many Connections

The architecture behind nginx and Redis: one thread, non-blocking sockets and epoll to serve many connections. Builds an echo server that accepts clients, reads and replies without blocking, and handles disconnects and errors correctly.

Sign in free to read this script, along with the rest of the library.

Sign in free