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
+8 -1
View File
@@ -17,6 +17,7 @@ export class WssConnexion {
this.userId = options.userId
this.roles = options.roles
this.sessionID = null // null until login
this.roundTripTime = 0
this.subscriptions = [];
this.usersWatched = [];
@@ -58,7 +59,7 @@ export class WssConnexion {
}
if(typeof this['action_'+action] == "function") {
if((this.debug) && (action != 'PONG')) console.warn(`${action} for uuid ${this.uuid}`);
if((this.debug) && (action != 'PONG rcv')) console.warn(`${action} for uuid ${this.uuid}`);
this['action_'+action](action, payload, reqid);
} else {
if(this.debug) console.warn(`Unknown action ${action} for UUID ${this.uuid}`);
@@ -72,9 +73,15 @@ export class WssConnexion {
keepAlive(){
this.latestPing = {
id: crypto.randomUUID(),
time: Date.now()
}
this.send(JSON.stringify({
'action': 'PING',
'reqid': this.latestPing.id,
}));
console.log('====>PING sent', this.latestPing)
this.keepAliveBomb = setTimeout(this.MissedKeepAlive.bind(this), (this.config.server.keepAliveTimeout+1)*1000);
}