4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 18:44:21 +08:00

add SO_REUSEADDR option to reuse the port in TIME-WAIT status (#1673)

This commit is contained in:
Zhensheng Yuan 2023-04-01 14:07:01 +08:00 committed by GitHub
parent b0dca720a8
commit 2c12f5f205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,6 +44,7 @@ def is_port_open(port: int):
"""
try:
sock = socket.socket()
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
_ = sock.bind(("", port))
sock.close()
return True