a whole bunch of things

This commit is contained in:
STEINNI
2026-06-21 21:08:04 +00:00
parent 01bf35a238
commit 1db846daa3
7 changed files with 56 additions and 38 deletions
+12 -5
View File
@@ -8,11 +8,18 @@ export const methods = {
{
"action": "PONG",
}
*/
action_PONG(action, payload){
clearTimeout(this.keepAliveBomb);
this.keepAliveNextTimeout = setTimeout(this.keepAlive.bind(this),this.config.server.keepAliveInterval*1000);
},
*/
action_PONG(action, payload, reqid){
if(reqid == this.latestPing.id) {
console.log('====>PONG', reqid, this.latestPing, Date.now() - this.latestPing.time)
this.roundTripTime = (this.roundTripTime + (Date.now() - this.latestPing.time)) / 2 //Exponential smoothing
}
// First defuse the bomb
clearTimeout(this.keepAliveBomb)
// Then setup the next one ;-)
this.keepAliveNextTimeout = setTimeout(this.keepAlive.bind(this),this.config.server.keepAliveInterval*1000);
},
/* Request: