LearnBoost/socket.io-client — pull request #531 by gabmontes (2013-03-22 14:14:59+00:00)
Title: Reconnectforever

Found useful to be able to set the client to keep trying to reconnect to the server forever. So in the first commit, added a condition to ```maybeReconnect``` to interpret negative, i.e. '-1' as reconnect forever.

The other commit properly caps the reconnection delay to the limit set through the options. The issue is in the condition to decide if the delay should be multiplied. In the edge case the current delay is slight less than the limit, it will be multiplied anyway and then the new actual delay will be almost twice as the limit set/expected. For example, if delay = 100 and limit = 2000, the actual delays are:

100 > 200 > 400 > 800 > 1600 > 3200 > 3200 > ...

With the new condition:

100 > 200 > 400 > 800 > 1600 > 2000 > 2000 > ...