[issue8498] Cannot use backlog = 0 for sockets

Daniel Evers report at bugs.python.org
Thu Apr 22 22:02:04 CEST 2010


Daniel Evers <dermojo at googlemail.com> added the comment:

Thanks for your help. I'll close the listen socket.

Nevertheless I'd like to understand the check in sock_listen. The commit message is not very helpful, I agree, that's why I wrote this issue. 0 is a valid value, and I'd suggest two ways to handle this situation:
1. Always set backlog at least to 1 (like now), but make this explicit in the documentation (docs.python.org says "should be at least 1" which is not the same as "will be at least 1")
2. Allow backlog = 0 and make a note in the docs that the exact behaviour will be implementation/OS-specific.

In case (1) the hint to close the listen socket should also be added to the documentation.

----------

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


More information about the Python-bugs-list mailing list