angelobreuer / Lavalink4NET

Lavalink4NET is a Lavalink wrapper with node clustering, caching and custom players for .NET with support for Discord.Net, DSharpPlus, Remora, and NetCord.
https://lavalink4net.angelobreuer.de/
MIT License
150 stars 27 forks source link

Nodes stop trying to reconnect after reconnecting once #22

Closed turulix closed 4 years ago

turulix commented 4 years ago

Describe the bug A node stops trying to reconnect when it already reconnected once

To Reproduce Steps to reproduce the behavior:

  1. Start Lavalink
  2. Connect to it using Lavalink4Net
  3. Stop Lavalink
  4. Start Lavalink
  5. Stop Lavalink
  6. Start Lavalink
  7. See error

Expected behavior A node should try to reconnect till it gets canceled via a event.

Screenshots If applicable, add screenshots to help explain your problem.

(please complete the following information):

Additional context Bug is caused by https://github.com/angelobreuer/Lavalink4NET/blob/56232d0aa84f94c922bfa3a0f8c8dce15b77796d/src/Lavalink4NET/LavalinkSocket.cs#L518-L522 being return not break

angelobreuer commented 4 years ago

Thanks for your report:

As you stated above I changed the return to a break; now the receive cycle continues after a reconnect: https://github.com/angelobreuer/Lavalink4NET/blob/f216647f768426121a068b4605b83a61d86181a3/src/Lavalink4NET/LavalinkSocket.cs#L518-L522

(https://github.com/angelobreuer/Lavalink4NET/commit/f216647f768426121a068b4605b83a61d86181a3; angelobreuer-patch-1).

I checked if the problem persists and now my client reconnects to the lavalink server once the connection is closed or aborted by the remote side (multiple tests).

You can download the build artifacts from the CI server: https://ci.appveyor.com/project/angelobreuer/lavalink4net/builds/31408139/artifacts

Please re-open the issue if the problem persists after the fix.