Code

View on GitHub

Chat server #

Build and run the simple TCP chat server based on select():

make select_chat && ./select_chat

select_chat.c

Connect a few clients and send some messages:

nc localhost 8090

Now try epoll() version:

make epoll_chat && ./epoll_chat

epoll_chat.c