wilk / ng-websocket

AngularJS HTML5 WebSocket powerful library
MIT License
267 stars 78 forks source link

Exponential number of reconnects #17

Closed everflux closed 8 years ago

everflux commented 9 years ago

When trying to open the websocket and automatic reconnect is enabled, an exponential number of retries are taking place.

I believe this is due no checking if a close event is already part of a retry or not. Clearing the reconnect interval-task before scheduling one fixes the issue: line 169

if (me.$$config.reconnect) {
                   if (me.$$reconnectTask) {
                        clearInterval(me.$$reconnectTask);
                        delete me.$$reconnectTask;
                    }
deiucanta commented 9 years ago

I can confirm this bug. @wilk can you fix it?

cdupetit commented 9 years ago

@wilk : There is a commit here to correct the bug.

bojanbass commented 9 years ago

Hi there, are there any plans to merge this fix into master?

wilk commented 8 years ago

This project is no longer mainteined. Sorry.