mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
fix(runtime) Avoid windows reserved port (#7722)
Co-authored-by: Carlos Freund <carlosfreund@gmail.com>
This commit is contained in:
parent
9b9b1291fc
commit
f2b4772ac2
@ -6,7 +6,7 @@ import time
|
||||
def check_port_available(port: int) -> bool:
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
try:
|
||||
sock.bind(('localhost', port))
|
||||
sock.bind(('0.0.0.0', port))
|
||||
return True
|
||||
except OSError:
|
||||
time.sleep(0.1) # Short delay to further reduce chance of collisions
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user