Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnecting question #118

Open
tolvaly opened this issue May 15, 2018 · 5 comments
Open

Reconnecting question #118

tolvaly opened this issue May 15, 2018 · 5 comments

Comments

@tolvaly
Copy link

tolvaly commented May 15, 2018

I have 2 questions regarding reconnect

  1. If the first connect fails, no more reconnects are made automatically. Can we enable auto reconnect on connect failure?

  2. 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?

@matthew-valenti
Copy link

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.

@tolvaly
Copy link
Author

tolvaly commented Jun 1, 2018

Our solution was very similar to your solution. I just asked if there is any built-in option which was forgotten from the wiki

@andmaltes
Copy link

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

@tolvaly tolvaly closed this as completed Nov 7, 2019
@tolvaly tolvaly reopened this Nov 7, 2019
@tolvaly
Copy link
Author

tolvaly commented Nov 7, 2019

Sorry, I don't remember our solution, it's a really old thread. This solution what you wrote could work.

@Vasanthvivi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants