pladaria / reconnecting-websocket

Reconnecting WebSocket. For Web, React Native, cli (Node.js)
MIT License
1.22k stars 197 forks source link

What if no on-close event is triggered? #54

Closed amanjaggaPracto closed 6 years ago

amanjaggaPracto commented 6 years ago

If no on-close event is triggered and this can happen due to situations like network failures etc. Do you handle these scenario's for reconnecting?

pladaria commented 6 years ago

That should be handled by the underlying WebSocket.

Normally, in the application layer, a ping mechanism should be implemented (like in the xmpp protocol) if a ping timeouts, you can call reconnect method to restart the connection.