Skip to content

Nodes do not attempt reconnecting after initial connection refused #32

Open
@freyacodes

Description

@freyacodes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions