MCPcopy
hub / github.com/coder/mux / closeWebSocket

Function closeWebSocket

src/node/orpc/server.test.ts:91–100  ·  view source on GitHub ↗
(ws: WebSocket)

Source from the content-addressed store, hash-verified

89}
90
91async function closeWebSocket(ws: WebSocket): Promise<void> {
92 if (ws.readyState === WebSocket.CLOSED) {
93 return;
94 }
95
96 await new Promise<void>((resolve) => {
97 ws.once("close", () => resolve());
98 ws.close();
99 });
100}
101
102function createHttpClient(
103 baseUrl: string,

Callers 2

server.test.tsFile · 0.70

Calls 2

closeMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected