Skip to content

Commit

Permalink
fix: emit ping when receiving a ping from the server
Browse files Browse the repository at this point in the history
The "ping" event was forgotten when reversing the ping-pong mechanism
in [1]. It will now be properly emitted when receiving a ping from the
server.

[1]: 81d7171

Related: socketio/socket.io-client#1475
  • Loading branch information
darrachequesne committed Jun 22, 2021
1 parent 2525f14 commit 589d3ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ class Socket extends Emitter {
case "ping":
this.resetPingTimeout();
this.sendPacket("pong");
this.emit("ping");
this.emit("pong");
break;

Expand Down

0 comments on commit 589d3ad

Please sign in to comment.