MCPcopy Create free account
hub / github.com/DemonMartin/tlsClient / stopServer

Function stopServer

tests/test.simple_request.ts:24–33  ·  view source on GitHub ↗

Stops accepting connections, tears down open sockets, then resolves when the server is fully closed.

(server: Server)

Source from the content-addressed store, hash-verified

22
23/** Stops accepting connections, tears down open sockets, then resolves when the server is fully closed. */
24function stopServer(server: Server): Promise<void> {
25 return new Promise((resolve, reject) => {
26 server.close((err) => {
27 if (err) reject(err);
28 else resolve();
29 });
30 // Without this, keep-alive / Go-side idle conns can leave close() pending forever.
31 server.closeAllConnections?.();
32 });
33}
34
35const moduleClient = new ModuleClient();
36

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected