fixes and tweaks. implemented polling reload on HB loss
This commit is contained in:
+1
-1
@@ -50,7 +50,7 @@ GLOBAL_CFLAGS = \
|
||||
-DDEBUG_ANSI=1 \
|
||||
-DDEBUG_ANSI_NOIMPL=1 \
|
||||
-DHTTPD_MAX_BACKLOG_SIZE=8192 \
|
||||
-DHTTPD_MAX_HEAD_LEN=512 \
|
||||
-DHTTPD_MAX_HEAD_LEN=1024 \
|
||||
-DHTTPD_MAX_POST_LEN=512 \
|
||||
-DDEBUG_INPUT=0 \
|
||||
-DDEBUG_HEAP=1 \
|
||||
|
||||
+15
-3
@@ -1958,6 +1958,7 @@ var Screen = (function () {
|
||||
var Conn = (function() {
|
||||
var ws;
|
||||
var heartbeatTout;
|
||||
var pingIv;
|
||||
|
||||
function onOpen(evt) {
|
||||
console.log("CONNECTED");
|
||||
@@ -2023,12 +2024,23 @@ var Conn = (function() {
|
||||
|
||||
function heartbeat() {
|
||||
clearTimeout(heartbeatTout);
|
||||
heartbeatTout = setTimeout(heartbeatFail, 3000);
|
||||
heartbeatTout = setTimeout(heartbeatFail, 2000);
|
||||
}
|
||||
|
||||
function heartbeatFail() {
|
||||
console.error("Heartbeat lost, reloading...");
|
||||
location.reload();
|
||||
console.error("Heartbeat lost, probing server...");
|
||||
pingIv = setInterval(function() {
|
||||
console.log("> ping");
|
||||
$.get('http://'+_root+'/system/ping', function(resp, status) {
|
||||
if (status == 200) {
|
||||
clearInterval(pingIv);
|
||||
console.info("Server ready, reloading page...");
|
||||
location.reload();
|
||||
}
|
||||
}, {
|
||||
timeout: 100,
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
+15
-3
@@ -392,6 +392,7 @@ var Screen = (function () {
|
||||
var Conn = (function() {
|
||||
var ws;
|
||||
var heartbeatTout;
|
||||
var pingIv;
|
||||
|
||||
function onOpen(evt) {
|
||||
console.log("CONNECTED");
|
||||
@@ -457,12 +458,23 @@ var Conn = (function() {
|
||||
|
||||
function heartbeat() {
|
||||
clearTimeout(heartbeatTout);
|
||||
heartbeatTout = setTimeout(heartbeatFail, 3000);
|
||||
heartbeatTout = setTimeout(heartbeatFail, 2000);
|
||||
}
|
||||
|
||||
function heartbeatFail() {
|
||||
console.error("Heartbeat lost, reloading...");
|
||||
location.reload();
|
||||
console.error("Heartbeat lost, probing server...");
|
||||
pingIv = setInterval(function() {
|
||||
console.log("> ping");
|
||||
$.get('http://'+_root+'/system/ping', function(resp, status) {
|
||||
if (status == 200) {
|
||||
clearInterval(pingIv);
|
||||
console.info("Server ready, reloading page...");
|
||||
location.reload();
|
||||
}
|
||||
}, {
|
||||
timeout: 100,
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
+1
-1
Submodule libesphttpd updated: 566e95af0c...13fa224963
+1
-1
@@ -11,7 +11,7 @@
|
||||
|
||||
#define LOOPBACK 0
|
||||
|
||||
#define HB_TIME 1500
|
||||
#define HB_TIME 1000
|
||||
|
||||
#define SOCK_BUF_LEN 2000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user