listen() ignores the backlog argument?

The backlog argument to listen() is only advisory.

POSIX says:

The backlog argument provides a hint
to the implementation which the
implementation shall use to limit the
number of outstanding connections in
the socket’s listen queue.

Current versions of the Linux kernel round it up to the next highest power of two, with a minimum of 16. The revelant code is in reqsk_queue_alloc().

Leave a Comment