Message103961
> Furthermore, python's socket documentation makes it clear:
Why does CPython go out of its way to make it impossible to pass 0 to the platform listen() API? The part of the specification you quoted makes it very clear that 0 is a valid value for this argument. And 0 seems to have a very different meaning than 1, but for some reason CPython thinks that 1 is a better thing for 0 to mean.
Perhaps there is a real reason someone thought to add this check in sock_listen, but if not, I think it's worth considering removing this check.
Unfortunately the commit message for the revision which added this check (r3880) is not informative:
sock_listen: ensure backlog argument is at least1
> If you really want to only accept 1 connection (I'm talking of sending back a SYN-ACK, not an accept() call), you can just close the server socket
This makes perfect sense, though, and is good advice in general. |
|
Date |
User |
Action |
Args |
2010-04-22 13:12:48 | exarkun | set | recipients:
+ exarkun, tarek, neologix, Daniel.Evers |
2010-04-22 13:12:47 | exarkun | set | messageid: <1271941967.66.0.351386653677.issue8498@psf.upfronthosting.co.za> |
2010-04-22 13:12:44 | exarkun | link | issue8498 messages |
2010-04-22 13:12:42 | exarkun | create | |
|