Issue 982681: asyncore.dispatcher.set_reuse_addr() is broken on windows (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/40483

classification

Title: asyncore.dispatcher.set_reuse_addr() is broken on windows
Type: Stage:
Components: Library (Lib) Versions: Python 2.4

process

Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, garth42, tim.peters
Priority: normal Keywords: patch

Created on 2004-06-30 11:14 by garth42, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
asyncore.py.patch garth42,2004-06-30 11:14 asyncore.py patch
Messages (5)
msg46280 - (view) Author: Garth Bushell (garth42) Date: 2004-06-30 11:14
asyncore.dispatcher.set_reuse_addr() uses socket.SO_REUSEADDR to allow reuse of same address without having to wait. On windows this also allows multiple programs to bind to the same socket adress. What is probably needed is to use SO_EXCLUSIVEADDRUSE on windows which has the same meaning as SO_REUSEADDR on all other platforms. This will stop people running the server multiple times and getting wierd results or two programs sharing the same port without realising.
msg46281 - (view) Author: Garth Bushell (garth42) Date: 2004-06-30 11:14
Logged In: YES user_id=45280 this depends on patch #982665
msg46282 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2004-07-10 15:52
Logged In: YES user_id=11375 Checked into CVS; thanks.
msg46283 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2004-08-13 18:19
Logged In: YES user_id=11375 SO_EXCLUSIVEADDRUSE actually has quite different semantics from what SO_REUSEADDR is intended to be; backing out this change.
msg46284 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-08-13 22:47
Logged In: YES user_id=31435 Noting that the patch broke the test suite for ZEO (Zope's networked-database layer on top of ZODB) on Windows. That all worked again after Andrew backed out the patch.
History
Date User Action Args
2022-04-11 14:56:05 admin set github: 40483
2004-06-30 11:14:00 garth42 create