If reconnect is called on a client WITHOUT being first closed, it will close first.

This commit is contained in:
Robinson 2023-08-30 12:02:04 +02:00
parent 364b29fd0c
commit f631dea046
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 6 additions and 0 deletions

View File

@ -226,6 +226,12 @@ open class Client<CONNECTION : Connection>(
logger.info { "Reconnecting... (timeout in $connectionTimeoutSec seconds)" }
}
if (!isShutdown()) {
// if we aren't closed already, close now.
close(false)
waitForClose()
}
connect(
remoteAddress = address,
remoteAddressString = addressString,