Open mtmk opened 7 months ago
This should be as simple as closing the socket and let the retry logic take its course.
Hi Guys! I'd like to contribute and have a few questions.
What should be the desired behavior when invoking ReconnectAsync
on a closed connection? Should it attempt to reconnect, or just return without doing anything?
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?
Hi Guys! I'd like to contribute and have a few questions.
thank you @pzajaczkowski 🎉
- 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.
- 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 temporaryConnectionOpened
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