Issue #8184: multiprocessing: On Windows, don't set SO_REUSEADDR on Connection
sockets, and set FILE_FLAG_FIRST_PIPE_INSTANCE on named pipes, to make sure two
listeners can't bind to the same socket/pipe (or any existing socket/pipe).
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index e5beb97..f141bd4 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -1779,6 +1779,17 @@
self.assertRaises(RuntimeError, reduction.recv_handle, conn)
p.join()
+class _TestListener(BaseTestCase):
+
+ ALLOWED_TYPES = ('processes')
+
+ def test_multiple_bind(self):
+ for family in self.connection.families:
+ l = self.connection.Listener(family=family)
+ self.addCleanup(l.close)
+ self.assertRaises(OSError, self.connection.Listener,
+ l.address, family)
+
class _TestListenerClient(BaseTestCase):
ALLOWED_TYPES = ('processes', 'threads')
@@ -1799,6 +1810,7 @@
self.assertEqual(conn.recv(), 'hello')
p.join()
l.close()
+
#
# Test of sending connection and socket objects between processes
#