console.js/fhemweb.js: changeing websocket ping (Forum #85080)

git-svn-id: https://svn.fhem.de/fhem/trunk@16348 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2018-03-07 21:02:42 +00:00
parent 091414142d
commit c5dc9d977e
2 changed files with 4 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ var consLastIndex = 0;
var withLog = 0;
var mustScroll = 1;
log("Console is opening");
log("Event monitor is starting");
function
cons_closeConn()
@@ -91,7 +91,7 @@ consFill()
consConn.onclose =
consConn.onerror =
consConn.onmessage = consUpdate;
setTimeout(function(){FW_wsPing(consConn);}, 30000);
consConn.onopen = function(){FW_wsPing(consConn);};
} else {
if(consConn) {

View File

@@ -1108,7 +1108,7 @@ FW_longpoll()
FW_pollConn.onclose =
FW_pollConn.onerror =
FW_pollConn.onmessage = FW_doUpdate;
setTimeout(function(){FW_wsPing(FW_pollConn);}, 30000);
FW_pollConn.onopen = function(){FW_wsPing(FW_pollConn);};
} else {
FW_pollConn = new XMLHttpRequest();
@@ -1131,7 +1131,7 @@ FW_wsPing(conn) // idle websockets are closed by the browser after 55sec
if(!conn || conn.readyState != conn.OPEN)
return;
conn.send("\n");
setTimeout(function(){FW_wsPing(conn);}, 30000);
// setTimeout(function(){FW_wsPing(conn);}, 30000);
}
/*************** LONGPOLL END **************/