pladaria / reconnecting-websocket

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

Provide timestamp of next connection attempt #38

Open remko opened 6 years ago

remko commented 6 years ago

I'd like to inform the user that there's a connectivity problem, and when the next attempt will be to restore the connection. To do that, I'd have to know when the websocket will attempt to reconnect (e.g. through a timestamp property on the ReconnectingWebSocket object that tells when the next connection attempt will be).

pladaria commented 6 years ago

Interesting. Maybe a better idea would be to accept via constructor a function getReconnectingDelay(retryNumber), so you can have full control of that.

Would that fit your needs?

remko commented 6 years ago

@pladaria It would solve my problem.