Message104614
test_support.find_unused_port attempts to find an unused port to use. The approach is fragile (as noted in the docstring) in certain cases. In particular, it appears that Windows takes a short time to free the socket after it is closed, meaning that when the caller tries to open a socket on the returned port number, it gets permission issues.
A sleep(0.1) just before returning the port number appears to address the issue, but this is not a proper solution.
http://msdn.microsoft.com/en-us/library/ms737582%28v=VS.85%29.aspx describes the SO_LINGER and SO_DONTLINGER socket options, which may be related, but in my initial tests I haven't been able to get these to work. |
|
Date |
User |
Action |
Args |
2010-04-30 09:18:06 | paul.moore | set | recipients:
+ paul.moore |
2010-04-30 09:18:04 | paul.moore | set | messageid: <1272619084.25.0.373754420183.issue8576@psf.upfronthosting.co.za> |
2010-04-30 09:18:02 | paul.moore | link | issue8576 messages |
2010-04-30 09:18:00 | paul.moore | create | |
|