mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
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).
This commit is contained in:
parent
1aa54a417d
commit
ed4a8fc095
4 changed files with 26 additions and 3 deletions
|
@ -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
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue