[issue21455] add default backlog to socket.listen()

STINNER Victor report at bugs.python.org
Mon May 12 23:47:05 CEST 2014


STINNER Victor added the comment:

> Py_MIN(SOMAXCONN, 128)

On Windows, it's not the best choice to use this hardcoded limit. socket.SOMAXCONN is 2^31-1.

listen() documentation says that Windows chooses a reasonable backlog value for you if you pass SOMAXCONN:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms739168%28v=vs.85%29.aspx

You should maybe use SOMAXCONN by default on Windows, and Py_MIN(SOMAXCONN, 128) by default on other platforms (UNIX).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21455>
_______________________________________


More information about the Python-bugs-list mailing list