MCPcopy Create free account
hub / github.com/QuantaAlpha/claude-code / close

Method close

src/utils/mcpWebSocketTransport.ts:159–168  ·  view source on GitHub ↗

* Closes the WebSocket connection.

()

Source from the content-addressed store, hash-verified

157 * Closes the WebSocket connection.
158 */
159 async close(): Promise<void> {
160 if (
161 this.ws.readyState === WS_OPEN ||
162 this.ws.readyState === WS_CONNECTING
163 ) {
164 this.ws.close()
165 }
166 // Ensure listeners are removed even if close was called externally or connection was already closed
167 this.handleCloseCleanup()
168 }
169
170 /**
171 * Sends a JSON-RPC message over the WebSocket connection.

Callers

nothing calls this directly

Calls 2

handleCloseCleanupMethod · 0.95
closeMethod · 0.65

Tested by

no test coverage detected