mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Issue 5177: use socket.SO_REUSEADDR on multiprocessing SocketManager sockets
This commit is contained in:
parent
5cb104d1b9
commit
459a648166
3 changed files with 29 additions and 0 deletions
|
@ -214,6 +214,7 @@ class SocketListener(object):
|
|||
'''
|
||||
def __init__(self, address, family, backlog=1):
|
||||
self._socket = socket.socket(getattr(socket, family))
|
||||
self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
self._socket.bind(address)
|
||||
self._socket.listen(backlog)
|
||||
self._address = self._socket.getsockname()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue