MCPcopy Create free account
hub / github.com/Effect-TS/effect / onClose

Function onClose

packages/platform/node/src/NodeHttpServer.ts:496–504  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

494 Effect.callback<NodeWS.WebSocket, Socket.SocketError>((resume) => {
495 // A refused handshake never invokes the callback, so fail on close instead.
496 const onClose = () =>
497 resume(Effect.fail(
498 new Socket.SocketError({
499 reason: new Socket.SocketOpenError({
500 kind: "Unknown",
501 cause: new Error("The socket closed before the upgrade")
502 })
503 })
504 ))
505 if (socket.destroyed) return onClose()
506 socket.once("close", onClose)
507 wss.handleUpgrade(nodeRequest, socket, head, (ws) => {

Callers 1

makeUpgradeHandlerFunction · 0.70

Calls 2

failMethod · 0.65
resumeFunction · 0.50

Tested by

no test coverage detected