question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The first OnReconnectAttempt will not trigger when reconnecting

See original GitHub issue

Hi, OnReconnectAttempt invokes only for the second connection attempt, so it can be a few seconds delay between the client receives OnDisconnected and OnReconnectAttempt events. It would be helpful if reconnection event is invoked as soon as the reconnection starts. Pull request #183

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
doghappycommented, Aug 3, 2021

yeah, at the same time we can delete these codes?

~if (Attempts == 0)~ ~{~ ~_reconnectionDelay = Options.ReconnectionDelay;~ ~}~ ~else~ if (Attempts > 0) { OnReconnectAttempt?.Invoke(this, Attempts); }

1reaction
DmitryBkcommented, Aug 3, 2021

yep, it should fix the issue! Just one note, it seems we should also add _reconnectionDelay = Options.ReconnectionDelay; to this place because it will not work in ConnectAsync if Attempts will start from 1. Or just move it before loop begining in ConnectAsync

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does the reconnect function not trigger on manual ...
The first one is that you ensure that you're handling the reconnection logic and the second is the you're handling the connection error...
Read more >
Releases · doghappy/socket.io-client-csharp
fix: first OnReconnectAttempt will not triggered when reconnecting · fix: incorrect disconnect reason.
Read more >
when reconnecting, disconnect event is triggered after ...
Describe the bug after establishing connect, cut down network of client side for 5~8 seconds, and then recover network, you will see the ......
Read more >
Client API
In the first two cases (explicit disconnection), the client will not try to reconnect and you need to manually call socket.connect() .
Read more >
Reconnect if disconnected
I do have "Reconnect automatically" selected in profile but it does not seem to work as if I simply choose disconnect from menu...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found