a whole bunch of things
This commit is contained in:
+8
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user