MCPcopy
hub / github.com/soketi/soketi / evictSocketFromMemory

Method evictSocketFromMemory

src/ws-handler.ts:217–226  ·  view source on GitHub ↗

* Evict the local socket.

(ws: WebSocket)

Source from the content-addressed store, hash-verified

215 * Evict the local socket.
216 */
217 evictSocketFromMemory(ws: WebSocket): Promise<void> {
218 return this.unsubscribeFromAllChannels(ws, true).then(() => {
219 if (ws.app) {
220 this.server.adapter.removeSocket(ws.app.id, ws.id);
221 this.server.metricsManager.markDisconnection(ws);
222 }
223
224 this.clearTimeout(ws);
225 });
226 }
227
228 /**
229 * Handle the event to close all existing sockets.

Callers 4

onCloseMethod · 0.95
closeAllLocalSocketsMethod · 0.95
handlePongMethod · 0.95
subscribeToChannelMethod · 0.95

Calls 4

clearTimeoutMethod · 0.95
removeSocketMethod · 0.65
markDisconnectionMethod · 0.65

Tested by

no test coverage detected