MCPcopy
hub / github.com/redis/node-redis / closeConnection

Method closeConnection

packages/test-utils/lib/proxy/redis-proxy.ts:193–204  ·  view source on GitHub ↗
(connectionId: string)

Source from the content-addressed store, hash-verified

191 }
192
193 public closeConnection(connectionId: string): boolean {
194 const connection = this.connections.get(connectionId);
195 if (!connection) {
196 return false;
197 }
198
199 connection.clientSocket.destroy();
200 connection.serverSocket.destroy();
201 this.connections.delete(connectionId);
202 this.emit('disconnect', connection);
203 return true;
204 }
205
206 public sendToClient(connectionId: string, data: Buffer): SendResult {
207 const connection = this.connections.get(connectionId);

Callers 1

stopMethod · 0.95

Calls 3

deleteMethod · 0.80
destroyMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected