MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / closeSocket

Function closeSocket

extension/background.js:25–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23}
24
25function closeSocket() {
26 if (heartbeatInterval) clearInterval(heartbeatInterval);
27 heartbeatInterval = null;
28 if (reconnectTimeout) clearTimeout(reconnectTimeout);
29 reconnectTimeout = null;
30 if (ws) {
31 try {
32 ws.close();
33 } catch (e) {
34 console.log("[Flow2API] Close socket error", e);
35 }
36 ws = null;
37 }
38}
39
40function sleep(ms) {
41 return new Promise(resolve => setTimeout(resolve, ms));

Callers 1

background.jsFile · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected