Coder Perfect

[closed] select versus poll vs epoll


I’m working on a new server that will handle hundreds of UDP connections (somewhere around 100,000 sessions). Do you have any ideas or suggestions for which one to use?

Asked by ravi

Solution #1

If you’re using Linux, the answer is epoll; if you’re using FreeBSD or Mac OS X, the answer is kqueue; and if you’re using Windows, the answer is i/o completion ports.

There are a few more things you should (almost certainly) look into:

It’s also worth noting that, in contrast to TCP, UDP does not have “connections.” Because debugging network-based solutions might be difficult, it’s also in your best interest to start small and scale up.

Answered by Kalantir

Solution #2

CURL’s author produced a fantastic post about poll versus select vs event libraries.

Answered by unixman83

Solution #3

epoll (Linux) Windows:?? FreeBSD: kqueue

Wrapper libraries such as libevent and libev can abstract this away for you.

Answered by Yann Ramin

Post is based on