nmathewson/Libevent — pull request #38 by ellzey (2012-02-15 00:44:18+00:00)
Title: Support TCP_DEFER_ACCEPT sockopts for listeners

> This is something we can discuss; but from my tests - this drastically increased performance when dealing with thousands of new connections.

A listening socket can be enabled with the sockopt TCP_DEFER_ACCEPT. This
informs the kernel to not call the user-land accept() until real data has been
written to the socket.

A new flag LEV_OPT_DEFERRED_ACCEPT has been introduced to automatically set this
option. Optionally evutil_make_tcp_listen_socket_deferred() can be called
manually.