Skip to content

Commit ed34a45

Browse files
cdewberydarrachequesne
authored andcommitted
refactor: reset ping timeout on any incoming packet (#706)
The client will now match the behavior of the server. See also: socketio/engine.io@be7b4e7
1 parent 8270e00 commit ed34a45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lib/socket.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -663,14 +663,14 @@ export class Socket extends Emitter<
663663

664664
// Socket is live - any packet counts
665665
this.emitReserved("heartbeat");
666+
this.resetPingTimeout();
666667

667668
switch (packet.type) {
668669
case "open":
669670
this.onHandshake(JSON.parse(packet.data));
670671
break;
671672

672673
case "ping":
673-
this.resetPingTimeout();
674674
this.sendPacket("pong");
675675
this.emitReserved("ping");
676676
this.emitReserved("pong");

0 commit comments

Comments
 (0)