Weeble <[EMAIL PROTECTED]> added the comment:

Okay, I've uploaded a patch. As suggested, it passes 0 for the port 
number and the port is automatically assigned. It then extracts the port 
from the socket and passes it to the subprocess. Note that this means 
the subprocess inherits the listening socket, which I gather is less 
than ideal. However, as far as I can tell, this happens anyway if the 
subprocess is restarted, since the socket remains bound and listening 
the whole time. The patch also removes the use of SO_REUSEADDR because 
it is no longer needed.

This works without a problem for me on Windows XP, but I can't test it 
on anything more Unixy. I removed the three retries when it fails to 
bind a socket - it's not clear when this might fail and yet still be a 
good idea to retry, but I can put that back if that's something that 
shouldn't be messed with.

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1529142>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to