fix(runtime) Avoid windows reserved port (#7722)

Co-authored-by: Carlos Freund <carlosfreund@gmail.com>
This commit is contained in:
Carlos Freund 2025-04-18 16:18:46 +02:00 committed by GitHub
parent 9b9b1291fc
commit f2b4772ac2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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