MCPcopy Create free account
hub / github.com/cocoindex-io/cocoindex-code / daemon_socket_path

Function daemon_socket_path

src/cocoindex_code/_daemon_paths.py:39–50  ·  view source on GitHub ↗

Return the daemon socket/pipe address.

()

Source from the content-addressed store, hash-verified

37
38
39def daemon_socket_path() -> str:
40 """Return the daemon socket/pipe address."""
41 if sys.platform == "win32":
42 import hashlib
43
44 # Hash the runtime dir so COCOINDEX_CODE_RUNTIME_DIR (or the
45 # COCOINDEX_CODE_DIR fallback) overrides produce unique pipe names,
46 # preventing conflicts between different daemon instances (tests,
47 # users, etc.)
48 dir_hash = hashlib.md5(str(daemon_runtime_dir()).encode()).hexdigest()[:12]
49 return rf"\\.\pipe\cocoindex_code_{dir_hash}"
50 return str(daemon_runtime_dir() / "daemon.sock")
51
52
53def daemon_pid_path() -> Path:

Callers 7

e2e_daemonFunction · 0.90
is_daemon_runningFunction · 0.85
_cleanup_stale_filesFunction · 0.85
_wait_for_daemonFunction · 0.85
run_daemonFunction · 0.85

Calls 1

daemon_runtime_dirFunction · 0.85