MCPcopy
hub / github.com/theturtle32/WebSocket-Node / cleanupFailedConnection

Function cleanupFailedConnection

lib/WebSocketRequest.js:521–530  ·  view source on GitHub ↗
(connection)

Source from the content-addressed store, hash-verified

519};
520
521function cleanupFailedConnection(connection) {
522 // Since we have to return a connection object even if the socket is
523 // already dead in order not to break the API, we schedule a 'close'
524 // event on the connection object to occur immediately.
525 process.nextTick(function() {
526 // WebSocketConnection.CLOSE_REASON_ABNORMAL = 1006
527 // Third param: Skip sending the close frame to a dead socket
528 connection.drop(1006, 'TCP connection lost before handshake completed.', true);
529 });
530}
531
532module.exports = WebSocketRequest;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected