INNER CODE UNIT · JavaScript

interval

rainfu/xcoin · extensions/output/panacea/index.js:32

      const interval = setInterval(() => {
        this.wss.clients.forEach((ws) => {
          if (ws.isAlive === false) {
            ws.terminate();
            return;
          }
          ws.isAlive = false;
          ws.ping();
        });
      }, 60000);
      this.wss.on("close", function close() {
        clearInterval(interval);
      });
      console.log("WebSocket running on ws://%s:%s".green, ip, port);
      this.wss.on("connection", (ws) => {
        ws.isAlive = true;
        debug.msg(
          "Websocket new client join ".cyan +

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…