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:
parent
b0dca720a8
commit
2c12f5f205
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user