I have implemented a chat server in C/Linux that uses TCP sockets. It is currently using a single process and uses select() to keep the server from blocking. I've read that select() is a pretty slow method and I'm looking to upgrade the server to a more efficient version.
I'm currently looking at libevent but I was hoping that someone with experience in designing fast server code could give me some pointers on what some of the fastest technologies available are. Is libevent a solid choice or is there something better I should look into?
I really appreciate any help!
For Linux (only) you can use epoll, which is faster in most cases (but not all).
The main disadvantage of epoll is that it is supported on the Linux OS only (not portable).
In a summary note, epoll can monitor a very large number of descriptors and will return a list of only those that changed (no need to pass over all the original list of descriptors).