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

Function onClose

packages/platform/node-shared/src/NodeSocket.ts:266–272  ·  view source on GitHub ↗
(hadError: boolean)

Source from the content-addressed store, hash-verified

264 )
265 }
266 function onClose(hadError: boolean) {
267 const err = new Socket.SocketError({
268 reason: new Socket.SocketCloseError({ code: hadError ? 1006 : 1000 })
269 })
270 if (hadError) close(err)
271 else end(err)
272 }
273
274 function attachReadListeners(conn: Duplex) {
275 conn.on("readable", drain)

Callers

nothing calls this directly

Calls 5

closeFunction · 0.70
endFunction · 0.70
cleanupFunction · 0.70
failMethod · 0.65
resumeFunction · 0.50

Tested by

no test coverage detected