Ping Pong mechanism - Socket.io V4 #3854
-
I have some weird behaviour since the update to v4 so I ask here before opening an issue. Looking at the update of engine.io v4 it reverses the heartbeat mechanism: I was doing a set of operations like so on the server side: socket.conn.on('packet', async (packet: any) => {
logger.debug('PACKET TYPE', packet.type);
if (packet.type === 'ping') {
// Refreshing data here
}
}); Clients v2 and v3 would consistently connect to the server and print packet type 'ping' and I would be able to do my set of operations. Now the clients using the same version (v3) and connect to server v4, print either 'ping' or 'pong' so some would get 'ping', others 'pong'. So for example This result make the app skip some clients and therefore have some issue. Is this an expected behaviour, or my logic is wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
In order to clarify: the heartbeat mechanism was indeed reversed between Socket.IO v2 (including Engine.IO v3) and Socket.IO v3 (including Engine.IO v4). There was no change between Socket.IO v3 (including Engine.IO v4) and Socket.IO v4 (including Engine.IO v5) though.
This should not happen. Are you able to reproduce consistently? Could it be linked to socketio/engine.io@ff2b8ab? |
Beta Was this translation helpful? Give feedback.
In order to clarify: the heartbeat mechanism was indeed reversed between Socket.IO v2 (including Engine.IO v3) and Socket.IO v3 (including Engine.IO v4).
There was no change between Socket.IO v3 (including Engine.IO v4) and Socket.IO v4 (including Engine.IO v5) though.
This should not happen. Are you able to reproduce consistently?
Could it be linked to socketio/engine.io@ff2b8ab?