MCPcopy Create free account
hub / github.com/Noumena-Network/code / close

Method close

src/remote/appServer/client.ts:564–578  ·  view source on GitHub ↗
(message: string)

Source from the content-addressed store, hash-verified

562 }
563
564 private close(message: string): void {
565 if (this.closed) {
566 return
567 }
568 this.closed = true
569 for (const pending of this.pendingRequests.values()) {
570 pending.reject(new Error(message))
571 }
572 this.pendingRequests.clear()
573 this.events.pushLossless({ type: 'disconnected', message })
574 this.events.close()
575 try {
576 this.ws?.close()
577 } catch {}
578 }
579}

Callers 4

shutdownMethod · 0.95
openMethod · 0.95
handleRawMessageMethod · 0.95
enqueueEventMethod · 0.95

Calls 4

rejectMethod · 0.80
pushLosslessMethod · 0.80
clearMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected