One ping/pong failure will make the websocket disconnect, is that too sensitive ? #4161
-
Correct me if I am wrong I think that one ping/pong failure will make the websocket disconnect. Is this too sensitive, e.g. why doesn't the heartbeat mechanism add some re-try before it marks the websocket disconnect ? I know engine.io has reconnect option like reconnectionDelay & randomizationFactor (their meanings are obvious). I assume after a ping/pong failure socket.io will use a new websocket to reconnect. But I can't find a clear document to explain this reconnect process. Can someone shed some light on this ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That's a good question. If a ping/pong fails, then the WebSocket connection is surely in an invalid state, and thus retrying will only delay the reconnection.
Yes, that's right. The codebase is split in two projects:
Source: https://github.com/socketio/engine.io-client/
Source: https://github.com/socketio/socket.io-client/ |
Beta Was this translation helpful? Give feedback.
That's a good question. If a ping/pong fails, then the WebSocket connection is surely in an invalid state, and thus retrying will only delay the reconnection.
Yes, that's right. The codebase is split in two projects:
engine.io-client
package provides a WebSocket-like object, which falls back to HTTP long-polling (but no reconnection, similarly to the WebSocket API). The heartbeat mechanism happens here, and the connection gets closed if the heartbeat fails.Source: https://github.com/socketio/…