ng2-signalr
ng2-signalr copied to clipboard
Reconnecting question
I have 2 questions regarding reconnect
-
If the first connect fails, no more reconnects are made automatically. Can we enable auto reconnect on connect failure?
-
If the connection interrupts, the client will try for 10 times to reconnect. If even the last reconnect fails, the state sets to disconnect and doesn't try to reconnect any more. Is there any possibility to set this limit to infinite?
Not sure if this helps but we've implemented a custom retry. This is over simplified but basically, we listen for connection status, on error we delay, and then call connection start again. This allows us to create any retry logic we want.
Our solution was very similar to your solution. I just asked if there is any built-in option which was forgotten from the wiki
Hi, I am sorry to ask but I would like to know if this would be something like this:
signalR.connect().then(r => { this.connection = r; this.connection.status.subscribe((s: ConnectionStatus) => { if (s.value === 4) { this.connection.start(); } }); });
I
Sorry, I don't remember our solution, it's a really old thread. This solution what you wrote could work.
Hi, I am sorry to ask but I would like to know if this would be something like this:
signalR.connect().then(r => { this.connection = r; this.connection.status.subscribe((s: ConnectionStatus) => { if (s.value === 4) { this.connection.start(); } }); });
I
yes works fine but uses the another signalr connection id while establishing new connection