engine.io-client instantly permanently attempt to reconnect? #3995
-
I'm using the latest socketio versions (4.0) I have a WS server which is not always online. Is there a way to instantly permanently attempt to reconnect to it in case transport errors/connection refused are encountered? Default settings don't seem to work that way: if the server is down, socket.io-client gives up reconnect. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi! By default, the Socket.IO client will try to reconnect forever. Available options:
Documentation: https://socket.io/docs/v4/client-initialization/#reconnection
The Engine.IO client will not try to reconnect. It behaves like a classic WebSocket client, which means you'll have to manually reconnect. The reconnection is a feature of the Socket.IO client above.
Please note the neither the Engine.IO client nor the Socket.IO client will be able to reach a plain WebSocket server. Documentation: https://socket.io/docs/v4/#What-Socket-IO-is-not |
Beta Was this translation helpful? Give feedback.
Hi! By default, the Socket.IO client will try to reconnect forever. Available options:
reconnection
(defaults totrue
)reconnectionAttempts
(defaults toInfinity
)reconnectionDelay
(defaults to1000
)reconnectionDelayMax
(defaults to5000
)randomizationFactor
(defaults to0.5
)Documentation: https://socket.io/docs/v4/client-initialization/#reconnection
The Engine.IO client will not try to reconnect. It behaves like a classic WebSocket client, which means you'll have to manually reconnect. The reconnection is a feature of the Socket.IO client above.
Please note the neither the Engine.IO client nor the Soc…