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

Function can_connect_tcp

start_webui.py:42–47  ·  view source on GitHub ↗
(host: str, port: int, timeout_seconds: float = 1.5)

Source from the content-addressed store, hash-verified

40
41
42def can_connect_tcp(host: str, port: int, timeout_seconds: float = 1.5) -> bool:
43 try:
44 with socket.create_connection((host, port), timeout=timeout_seconds):
45 return True
46 except OSError:
47 return False
48
49def log(message: str, level: str = "INFO") -> None:
50 LOGS_DIR.mkdir(exist_ok=True)

Callers 2

ensure_postgres_serviceFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected