Skip to content

Commit

Permalink
Refresh ping timer
Browse files Browse the repository at this point in the history
  • Loading branch information
Nibbler999 committed Oct 31, 2021
1 parent fe5d97f commit ef4b018
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/socket.ts
Expand Up @@ -137,7 +137,7 @@ export class Socket extends EventEmitter {
return;
}
debug("got pong");
this.schedulePing();
this.pingIntervalTimer.refresh();
this.emit("heartbeat");
break;

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit ef4b018

Please sign in to comment.