joewalnes / reconnecting-websocket

A small decorator for the JavaScript WebSocket API that automatically reconnects
MIT License
4.21k stars 968 forks source link

Add maxReconnectAttempts option #42

Closed haileys closed 9 years ago

haileys commented 9 years ago

This pull request adds a maxReconnectAttempts option which controls the maximum number of reconnection attempts ReconnectingWebSocket will make before giving up.

This will allow users of this library to use short reconnection intervals without the risk of being smashed by potentially tens of thousands of clients trying to reconnect forever in case the WebSocket server goes down.

joewalnes commented 9 years ago

Merged. Thanks!