Index: lams_tool_doku/web/pages/learning/learning.jsp =================================================================== diff -u -r2364f530b04afc47ac32f6d4966a0a40d052410c -r6d721a0e00cff50aeec869b5399b5d2a49c54fa4 --- lams_tool_doku/web/pages/learning/learning.jsp (.../learning.jsp) (revision 2364f530b04afc47ac32f6d4966a0a40d052410c) +++ lams_tool_doku/web/pages/learning/learning.jsp (.../learning.jsp) (revision 6d721a0e00cff50aeec869b5399b5d2a49c54fa4) @@ -95,14 +95,18 @@ //init the connection with server using server URL but with different protocol - var dokuWebsocket = new WebSocket(''.replace('http', 'ws') + var dokuWebsocketInitTime = Date.now(), + dokuWebsocket = new WebSocket(''.replace('http', 'ws') + 'learningWebsocket?toolContentID=' + ${toolContentID}), dokuWebsocketPingTimeout = null, dokuWebsocketPingFunc = null; dokuWebsocketPingFunc = function(skipPing){ if (dokuWebsocket.readyState == dokuWebsocket.CLOSING || dokuWebsocket.readyState == dokuWebsocket.CLOSED){ + if (Date.now() - dokuWebsocketInitTime < 1000) { + return; + } location.reload(); } @@ -118,7 +122,8 @@ dokuWebsocket.onclose = function(){ // react only on abnormal close - if (e.code === 1006) { + if (e.code === 1006 && + Date.now() - dokuWebsocketInitTime > 1000) { location.reload(); } };