(source code is available for download in the article)
Compared to select(), the newer linux system call epoll() is designed to be more performant.
Ticker Plant uses epoll. No select() at all.
https://banu.com/blog/2/how-to-use-epoll-a-complete-example-in-c/ is a nice article with sample code of a TCP server.
- bind(), listen(), accept()
- main() function with an event loop. In the loop
- epoll_wait() to detect
- new client
- new data on existing clients
- (Using the timeout parameter, it could also react to a timer events.)
I think this toy program is more readable than a real-world epoll server with thousands of lines.