atmosphere icon indicating copy to clipboard operation
atmosphere copied to clipboard

If possible trigger event when maximum reconnect is reached

Open hapali opened this issue 13 years ago • 3 comments

atmosphere 1.0.5 Suppose maximum reconnect is reached, how do I know that? I see something in browser console, but just that.

If possible please trigger an event: $(document).trigger("atmosphere-reconnect-max-try-reached");

I faced also an issue with reconnecting. I set the value of maxReconnectOnClose=2 and start connecting. After that, I close the connection from the server. I expect that after each successful connection atmosphere.js to start over with counting the number of reconnects. I dont know if I am asking too much

request.maxReconnectOnClose = 2; subSocket = socket.subscribe(request);

console: Invoking executeWebSocket Websocket successfully opened Connected Websocket closed, reason: Unknown: no status code was provided even though one was expected. Websocket closed, wasClean: true Connection closed websocket

Invoking executeWebSocket Reconnected 1 Websocket successfully opened Websocket closed, reason: Unknown: no status code was provided even though one was expected. Websocket closed, wasClean: true Connection closed websocket

Invoking executeWebSocket Reconnected 2 Websocket successfully opened Websocket closed, reason: Unknown: no status code was provided even though one was expected. Websocket closed, wasClean: true Connection closed websocket Websocket reconnect maximum try reached 3 Websocket error, reason: Failed to connect with websocket

hapali avatar Dec 10 '12 16:12 hapali

Ya, clearly a bug. Can you file a differrent issue with it? Just don't want to mix the issue vs request for improvement

jfarcand avatar Dec 10 '12 16:12 jfarcand

sure

hapali avatar Dec 10 '12 19:12 hapali

The onError function will be called when the maximum is reached.

jfarcand avatar Dec 11 '12 14:12 jfarcand