MCPcopy Create free account
hub / github.com/1jehuang/jcode / socket_connectable

Function socket_connectable

scripts/profile_spawn.py:285–294  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

283
284
285def socket_connectable(path: str) -> bool:
286 if not os.path.exists(path):
287 return False
288 try:
289 s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
290 s.connect(path)
291 s.close()
292 return True
293 except OSError:
294 return False
295
296
297def find_child_server(env: dict[str, str], exclude: set[int]) -> int | None:

Callers 2

profile_server_spawnFunction · 0.85
profile_client_spawnFunction · 0.85

Calls 2

connectMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected