From ef4b01830ace018f48c679a755c24d810dc3d0b6 Mon Sep 17 00:00:00 2001 From: Tom Atkinson Date: Sun, 31 Oct 2021 18:34:11 +0100 Subject: [PATCH] Refresh ping timer --- lib/socket.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/socket.ts b/lib/socket.ts index f9293213..c7936d31 100644 --- a/lib/socket.ts +++ b/lib/socket.ts @@ -137,7 +137,7 @@ export class Socket extends EventEmitter { return; } debug("got pong"); - this.schedulePing(); + this.pingIntervalTimer.refresh(); this.emit("heartbeat"); break; @@ -170,7 +170,6 @@ export class Socket extends EventEmitter { * @api private */ private schedulePing() { - clearTimeout(this.pingIntervalTimer); this.pingIntervalTimer = setTimeout(() => { debug( "writing ping packet - expecting pong within %sms",