Nodes do not attempt reconnecting after initial connection refused
After calling Lavakord.addNode() and encountering a refused connection, this exception is raised:
Exception in thread "DefaultDispatcher-worker-9" java.net.ConnectException: Connection refused
at java.base/sun.nio.ch.Net.pollConnect(Native Method)
at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:673)
at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:973)
at io.ktor.network.sockets.SocketImpl.connect$ktor_network(SocketImpl.kt:50)
at io.ktor.network.sockets.SocketImpl$connect$1.invokeSuspend(SocketImpl.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
The coroutine then ends without retrying, as retries are only done when ReconnectException is caught.
java.net.ConnectException is JVM specific, so I am unsure how to catch it in multiplatform code
https://github.com/kordlib/Lavalink.kt/blob/21db0f3b9811b665c6bb65786454b8313909d221/core/src/jvmMain/kotlin/dev/schlaubi/lavakord/audio/internal/Platform.kt#L28-L30
That should be cought
Upon closer inspection, the problem is caused by the exception being thrown by check(), which has no fault tolerance.
I'm very tempted to just wrap a try/catch around check() for Exception