MCPcopy Index your code
hub / github.com/codeaashu/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 15

captureUntrackedFilesFunction · 0.45
storeImageFunction · 0.45
removeMessageByUuidMethod · 0.45
readEditContextFunction · 0.45
stopFunction · 0.45
readSessionStartDateFunction · 0.45
execFunction · 0.45
readHeadAndTailFunction · 0.45
readSessionLiteFunction · 0.45
readTranscriptForLoadFunction · 0.45
saveStatsCacheFunction · 0.45
readFileBytesFunction · 0.45

Calls 1

handleCloseCleanupMethod · 0.95

Tested by

no test coverage detected