MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / _wait_for_socket

Function _wait_for_socket

eval/run_compare.py:329–341  ·  view source on GitHub ↗
(host: str, port: int, *, timeout: float)

Source from the content-addressed store, hash-verified

327
328
329def _wait_for_socket(host: str, port: int, *, timeout: float) -> None:
330 import socket
331
332 deadline = time.monotonic() + timeout
333 while time.monotonic() < deadline:
334 with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
335 s.settimeout(1.0)
336 try:
337 s.connect((host, port))
338 return
339 except OSError:
340 time.sleep(0.5)
341 raise RuntimeError(f"Server at {host}:{port} did not accept connections within {timeout:.0f}s")
342
343
344def cmd_prepare(args: argparse.Namespace) -> int:

Callers 1

_spawn_serverFunction · 0.85

Calls 1

connectMethod · 0.45

Tested by

no test coverage detected