summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2012-02-08 20:15:58 (GMT)
committerCharles-François Natali <neologix@free.fr>2012-02-08 20:15:58 (GMT)
commited4a8fc0952a4211bc8bc929c23e11bebdfe9aa3 (patch)
tree5ef3babaa18c5b4e56847c3a556dd7cad4bb0ce0 /Lib/test
parent1aa54a417d767efb2ebb4c1a31e69f7be9b1d6ae (diff)
downloadcpython-ed4a8fc0952a4211bc8bc929c23e11bebdfe9aa3.zip
cpython-ed4a8fc0952a4211bc8bc929c23e11bebdfe9aa3.tar.gz
cpython-ed4a8fc0952a4211bc8bc929c23e11bebdfe9aa3.tar.bz2
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).
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_multiprocessing.py12
1 files changed, 12 insertions, 0 deletions
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 @@ class _TestConnection(BaseTestCase):
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 @@ class _TestListenerClient(BaseTestCase):
self.assertEqual(conn.recv(), 'hello')
p.join()
l.close()
+
#
# Test of sending connection and socket objects between processes
#