MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / resolve_available_port

Function resolve_available_port

start_webui.py:201–206  ·  view source on GitHub ↗
(host: str, preferred_port: int, max_scan: int = 100)

Source from the content-addressed store, hash-verified

199
200
201def resolve_available_port(host: str, preferred_port: int, max_scan: int = 100) -> int:
202 for offset in range(max_scan):
203 candidate = preferred_port + offset
204 if port_is_available(host, candidate):
205 return candidate
206 return preferred_port
207
208
209def wait_for_http(url: str, timeout_seconds: int) -> None:

Callers 1

mainFunction · 0.85

Calls 1

port_is_availableFunction · 0.85

Tested by

no test coverage detected