Reputation: 791
I am using socket.io to implement a real-time application. The client(Mobile phone web pages) connection get disconnects some time due to heartbeat test failure. That happened due to network issues. Is there a way to reconnect the connection on disconnect event from client side?
Upvotes: 0
Views: 345
Reputation: 1267
You can tune socket.io options to enable reconnection.
reconnection
- should be true
reconnectionDelay
(ms) - how long to wait before attempting a new
reconnectionreconnectionDelayMax
(ms) - maximum amount of time to wait between
reconnections. Each attempt increases the reconnection by
the amount specified by reconnectionDelay
.Upvotes: 1