MCPcopy Index your code
hub / github.com/nodejs/node / failWebsocketConnection

Function failWebsocketConnection

deps/undici/undici.js:15282–15292  ·  view source on GitHub ↗
(handler, code, reason, cause)

Source from the content-addressed store, hash-verified

15280 }
15281 __name(closeWebSocketConnection, "closeWebSocketConnection");
15282 function failWebsocketConnection(handler, code, reason, cause) {
15283 if (isEstablished(handler.readyState)) {
15284 closeWebSocketConnection(handler, code, reason, false);
15285 }
15286 handler.controller.abort();
15287 if (isConnecting(handler.readyState)) {
15288 handler.onSocketClose();
15289 } else if (handler.socket?.destroyed === false) {
15290 handler.socket.destroy();
15291 }
15292 }
15293 __name(failWebsocketConnection, "failWebsocketConnection");
15294 module2.exports = {
15295 establishWebSocketConnection,

Callers 8

processResponseFunction · 0.70
closeWebSocketConnectionFunction · 0.70
runMethod · 0.70
writeFragmentsMethod · 0.70
parseControlFrameMethod · 0.70
_WebSocketClass · 0.70
#onMessageMethod · 0.70

Calls 5

isEstablishedFunction · 0.70
closeWebSocketConnectionFunction · 0.70
isConnectingFunction · 0.70
abortMethod · 0.65
destroyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…