An event notification libraryhttp://libevent.org/
The libevent API provides a mechanism to execute a callback function
when a specific event occurs on a file descriptor or after a timeout
has been reached. Furthermore, libevent also support callbacks due to
signals or regular timeouts.
Currently, libevent supports /dev/poll, kqueue(2), event ports,
POSIX select(2), Windows select(), poll(2), and epoll(4).
Libevent additionally provides a sophisticated framework for buffered
network IO, with support for sockets, filters, rate-limiting, SSL,
zero-copy file transmission, and IOCP. Libevent includes support for
several useful protocols, including DNS, HTTP, and a minimal RPC