MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / peerIsDead

Function peerIsDead

src/mcp/daemon.ts:774–782  ·  view source on GitHub ↗
(
  peers: { pid: number | null; hostPid: number | null },
  isAlive: (pid: number) => boolean,
)

Source from the content-addressed store, hash-verified

772 * basis — those clients rely on the socket-close path. Exported for testing.
773 */
774export function peerIsDead(
775 peers: { pid: number | null; hostPid: number | null },
776 isAlive: (pid: number) => boolean,
777): boolean {
778 if (peers.pid === null) return false;
779 if (!isAlive(peers.pid)) return true;
780 if (peers.hostPid !== null && !isAlive(peers.hostPid)) return true;
781 return false;
782}
783
784/**
785 * Read the optional client-hello line a proxy sends after the daemon hello.

Callers 3

backstopShouldExitMethod · 0.85
reapDeadClientsMethod · 0.85

Calls 1

isAliveFunction · 0.50

Tested by

no test coverage detected