You are reading a single comment by @samppa and its replies. Click here to read the full conversation.
  • @Gordon : Closing and creating the server does not seem to resolve the jam.
    I made the inactivity checker like this:

    function checkInactivity() {
      if (Date.now() - lastPageHandled > 20000) {
        clearInterval(checkInactivityIntervalId);
        lastPageHandled = Date.now();
        console.log("Inactivity detected restarting webserver..."); 
        if (server) {
          server.close();
        }
        server = http.createServer(pageHandler);
        if (server) {
          console.log("Webserver restarted.");
          checkInactivityIntervalId = setInterval(checkInactivity, 2000);
          server.listen(80);
        } else {
          console.log("ERROR createServer() returned false."); 
          console.log(err); 
          setTimeout(function() { reboot(); }, 5000);
          return;
        }
      }
    }
    

    Should I do some deeper cleanup/reset/disconnection than just recreating the http server?

    Also I get these errors during the restart:

    >Uncaught Error: CIPSERVER failed (Timeout)
     at line 1 col 53
    throw Error("CIPSERVER failed ("+(a?a:"Timeout")+")");
                                                        ^
    in function called from system
    
About

Avatar for samppa @samppa started