MCPcopy
hub / github.com/mongodb/node-mongodb-native / destroy

Method destroy

src/cmap/connection.ts:334–346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

332 }
333
334 public destroy(): void {
335 if (this.closed) {
336 return;
337 }
338
339 // load balanced mode requires that these listeners remain on the connection
340 // after cleanup on timeouts, errors or close so we remove them before calling
341 // cleanup.
342 this.removeAllListeners(Connection.PINNED);
343 this.removeAllListeners(Connection.UNPINNED);
344 const message = `connection ${this.id} to ${this.address} closed`;
345 this.cleanup(new MongoNetworkError(message));
346 }
347
348 /**
349 * A method that cleans up the connection. When `force` is true, this method

Callers 15

_endStreamMethod · 0.45
getFunction · 0.45
abortMethod · 0.45
handleReadResultFunction · 0.45
doReadFunction · 0.45
initFunction · 0.45
closeMethod · 0.45
destroyConnectionMethod · 0.45
createConnectionMethod · 0.45
connectFunction · 0.45
makeSocketFunction · 0.45
cleanupMethod · 0.45

Calls 2

cleanupMethod · 0.95
removeAllListenersMethod · 0.80

Tested by

no test coverage detected