Neal Norwitz wrote: > That's what I was thinking of. I thought you had to be accept()ing > prior to connect() working. I thought listen() only sets the # of > outstanding connections allowed (basically internal buffer). But if > the listen() is sufficient, I agree there is no race.
Actually, that's the whole point of listen(). Even if you initially do accept() quickly, it might be that another connection request (SYN) arrives between return of accept() and the next call to accept(); this is essentially the same as connection requests arriving before the first accept() call. The kernel will acknowledge the SYN packet immediately, and do that for at most "number-of-backlog" incoming connections. Then, subsequent accept() calls will immediately return. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com