Author trent
Recipients trent
Date 2008-04-04.15:57:30
SpamBayes Score 0.105946
Marked as misclassified No
Message-id <>
Background: I came across this issue when trying to track down why 
test_asynchat would periodically wedge python processes on the Windows 
buildbots, to the point that they wouldn't even respond to SIGKILL (or 
ctrl-c on the console).

What I found after a bit of digging is that Windows doesn't raise 
EADDRINUSE socket.errors when you bind() two sockets to identical 
host/ports *IFF* SO_REUSEADDR has been set as a socket option.

Decided to brighten up my tube journey into work this morning by 
reading the Gospel's take on the situation.  As per the 'SO_REUSEADDR 
and SO_REUSEPORT Socket Options' section in chapter 7.5 of Stevens' 
UNIX Network Programming Volume 1 (2nd Ed):

"With TCP, we are never able to start multiple servers that bind
 the same IP address and same port: a completely duplicate binding.
 That is, we cannot start one server that binds port 80
 and start another that also binds port 80, even if we
 set the SO_REUSEADDR socket option for the second server."

So, it seems at least Windows isn't adhering to this, at least on XP 
and Server 2008 with 2.5-2.6.  I've patched to 
explicitly test for this situation -- as expected, it passes on Unix 
(tested on FreeBSD in particular), and fails on Windows.  I'd like to 
commit this to trunk to see if any of the buildbots for different 
platforms match the behaviour of Windows.
Date User Action Args
2008-04-04 15:58:00trentsetspambayes_score: 0.105946 -> 0.105946
recipients: + trent
2008-04-04 15:58:00trentsetspambayes_score: 0.105946 -> 0.105946
messageid: <>
2008-04-04 15:57:33trentlinkissue2550 messages
2008-04-04 15:57:32trentcreate