This parameter was accidentally removed when fixing
https://bugs.python.org/issue45129, this reverts the unnecessary changes
there.
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
sock=None,
backlog=100,
ssl=None,
+ reuse_address=None,
reuse_port=None,
ssl_handshake_timeout=None,
start_serving=True):
raise ValueError(
'host/port and sock can not be specified at the same time')
+ if reuse_address is None:
+ reuse_address = os.name == "posix" and sys.platform != "cygwin"
sockets = []
if host == '':
hosts = [None]
af, socktype, proto, exc_info=True)
continue
sockets.append(sock)
+ if reuse_address:
+ sock.setsockopt(
+ socket.SOL_SOCKET, socket.SO_REUSEADDR, True)
if reuse_port:
_set_reuseport(sock)
# Disable IPv4/IPv6 dual stack support (enabled by