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

Add (force) reconnect method #479

Closed
mtmk opened this issue Apr 16, 2024 · 3 comments · Fixed by #684
Closed

Add (force) reconnect method #479

mtmk opened this issue Apr 16, 2024 · 3 comments · Fixed by #684
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed new-feature

Comments

@mtmk
Copy link
Collaborator

mtmk commented Apr 16, 2024

@mtmk mtmk added help wanted Extra attention is needed new-feature good first issue Good for newcomers labels Apr 16, 2024
@mtmk
Copy link
Collaborator Author

mtmk commented May 10, 2024

This should be as simple as closing the socket and let the retry logic take its course.

@pzajaczkowski
Copy link
Contributor

Hi Guys! I'd like to contribute and have a few questions.

  1. What should be the desired behavior when invoking ReconnectAsync on a closed connection? Should it attempt to reconnect, or just return without doing anything?

  2. I'm also considering adding some wait logic to ensure that the ReconnectAsync task completes when the reconnection succeeds. I've been thinking about a temporary ConnectionOpened event subscription for this purpose. Would this approach make sense, or is there a preferred pattern for handling this?

@mtmk
Copy link
Collaborator Author

mtmk commented Nov 26, 2024

Hi Guys! I'd like to contribute and have a few questions.

thank you @pzajaczkowski 🎉

  1. What should be the desired behavior when invoking ReconnectAsync on a closed connection? Should it attempt to reconnect, or just return without doing anything?

if the connection is not open reconnect loop should be running behind the scenes to bring the connection up so it makes sense to not do anything in that case.

  1. I'm also considering adding some wait logic to ensure that the ReconnectAsync task completes when the reconnection succeeds. I've been thinking about a temporary ConnectionOpened event subscription for this purpose. Would this approach make sense, or is there a preferred pattern for handling this?

what would be the use case for that? The name might not make sense in this case I guess so maybe name as ForceReconnectAsync() instead? the reason I'm asking is that one scenario for this is to initiate a reconnect after receiving a LDM message from the server and the callback for it should just issue a reconnect but won't need to wait for the reconnection to happen. see also #23

feel free to start a PR we can discuss the details there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed new-feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants