Charles-François Natali <neolo...@free.fr> added the comment: > However, let me point out the following sentence: > “Ports without SO_EXCLUSIVEADDRUSE set may be reused as soon as the socket on > which bind was previously called is closed.” > > ...which seems to suggest we shouldn't use SO_REUSEADDR under Windows, since > Windows sockets appear to have the Unix SO_REUSEADDR semantics by default.
Actually, it seems that even though the documentation doesn't mention sockets in TIME_WAIT state, SO_REUSEADDR is actually required on Windows: http://twistedmatrix.com/trac/ticket/1151#comment:18 So the proper solution is the one adopted by support.bind_port(), SO_REUSEADDR + SO_EXCLUSIVEADDRUSE. Since Windows semantics is different (I'd rather say broken) and SO_REUSEADDR is currently mis-used throughout the stdlib, what do you think of adding a set_reuse() method to socket that would do the right thing? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8184> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com