Skip to content

Commit 589d3ad

Browse files
fix: emit ping when receiving a ping from the server
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
1 parent 2525f14 commit 589d3ad

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/socket.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ class Socket extends Emitter {
386386
case "ping":
387387
this.resetPingTimeout();
388388
this.sendPacket("pong");
389+
this.emit("ping");
389390
this.emit("pong");
390391
break;
391392

0 commit comments

Comments
 (0)