MCPcopy
hub / github.com/darkreader/darkreader / close

Function close

tests/browser/server.js:96–112  ·  view source on GitHub ↗

* @returns {Promise }

()

Source from the content-addressed store, hash-verified

94 * @returns {Promise<void>}
95 */
96 function close() {
97 if (!server) {
98 return;
99 }
100 return new Promise((resolve) => {
101 server.close((err) => {
102 if (err) {
103 console.error(err);
104 }
105 server = null;
106 resolve();
107 });
108 sockets.forEach((socket) => {
109 socket.destroy();
110 });
111 });
112 }
113
114 if (terminationListeners.length === 0) {
115 process.on('exit', terminationListener);

Callers

nothing calls this directly

Calls 1

destroyMethod · 0.65

Tested by

no test coverage detected