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

Function peerIsDead

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

Source from the content-addressed store, hash-verified

1106 * basis — those clients rely on the socket-close path. Exported for testing.
1107 */
1108export function peerIsDead(
1109 peers: { pid: number | null; hostPid: number | null },
1110 isAlive: (pid: number) => boolean,
1111): boolean {
1112 if (peers.pid === null) return false;
1113 if (!isAlive(peers.pid)) return true;
1114 if (peers.hostPid !== null && !isAlive(peers.hostPid)) return true;
1115 return false;
1116}
1117
1118/**
1119 * 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