See the backlog parameter mentioned here:
All listen() methods can take a backlog parameter to specify the maximum length of the queue of pending connections. The actual length will be determined by the OS through sysctl settings such as tcp_max_syn_backlog and somaxconn on Linux. The default value of this parameter is 511 (not 512).
A more thorough explanation of this parameter would be appreciated. Some questions that come to mind after reading that description:
- When is a connection 'pending' vs accepted?
- How do you max out this
backlog
limitation? - What happens when the
backlog
parameter is exceeded, is an error returned?