Skip to content

Commit

Permalink
perf: do not reset the hearbeat timer on each packet
Browse files Browse the repository at this point in the history
This reverts ed34a45

See also: socketio/engine.io@5359bae
  • Loading branch information
darrachequesne committed Sep 18, 2024
1 parent 60c757f commit 7a23dde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/engine.io-client/lib/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ export class SocketWithoutUpgrade extends Emitter<

// Socket is live - any packet counts
this.emitReserved("heartbeat");
this._resetPingTimeout();

switch (packet.type) {
case "open":
Expand All @@ -585,6 +584,7 @@ export class SocketWithoutUpgrade extends Emitter<
this._sendPacket("pong");
this.emitReserved("ping");
this.emitReserved("pong");
this._resetPingTimeout();
break;

case "error":
Expand Down

0 comments on commit 7a23dde

Please sign in to comment.