mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-03 14:28:41 +08:00
add SO_REUSEADDR option to reuse the port in TIME-WAIT status (#1673)
This commit is contained in:
1 parent
b0dca720a8
commit
2c12f5f205
1 file changed
+1
@@ -44,6 +44,7 @@ def is_port_open(port: int):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
sock = socket.socket()
|
sock = socket.socket()
|
||||||
|
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||||
_ = sock.bind(("", port))
|
_ = sock.bind(("", port))
|
||||||
sock.close()
|
sock.close()
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in new issue
Block a user