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

Function close

packages/platform/bun/src/BunHttpServer.ts:120–132  ·  view source on GitHub ↗
(ws, code, closeReason)

Source from the content-addressed store, hash-verified

118 ws.data.run(message)
119 },
120 close(ws, code, closeReason) {
121 code = typeof code === "number" ? code : 1001
122 Deferred.doneUnsafe(
123 ws.data.closeDeferred,
124 Socket.defaultCloseCodeIsError(code)
125 ? Exit.fail(
126 new Socket.SocketError({
127 reason: new Socket.SocketCloseError({ code, closeReason })
128 })
129 )
130 : Exit.void
131 )
132 }
133 }
134 })
135

Callers

nothing calls this directly

Calls 1

failMethod · 0.45

Tested by

no test coverage detected