MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / cleanSocketPath

Function cleanSocketPath

packages/mcp-server/src/hub.ts:179–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177type HubToolWithHandler = {
178 [Name in HubToolMetadata['name']]: HubToolWithHandlerFor<HubToolByName<Name>>
179}[HubToolMetadata['name']]
180
181type SocketProbeResult = 'live' | 'missing' | { staleCode: string }
182
183function classifySocketProbeError(error: NodeJS.ErrnoException): SocketProbeResult | null {
184 if (error.code === 'ENOENT') return 'missing'
185 if (error.code === 'ECONNREFUSED' || error.code === 'ENOTSOCK') {
186 return { staleCode: error.code }
187 }
188 return null
189}
190
191function probeHubSocket(): Promise<SocketProbeResult> {
192 return new Promise((resolve, reject) => {
193 let settled = false

Callers 1

initializeHubRuntimeFunction · 0.85

Calls 2

probeSocketPathFunction · 0.85
exitExistingHubFunction · 0.85

Tested by

no test coverage detected