mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
Merge 70717 to 26maint
This commit is contained in:
parent
e6bab480ac
commit
b48cfa679e
3 changed files with 32 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