diff --git a/src/dorkbox/network/Client.kt b/src/dorkbox/network/Client.kt index 13718d20..7e91d156 100644 --- a/src/dorkbox/network/Client.kt +++ b/src/dorkbox/network/Client.kt @@ -132,7 +132,7 @@ open class Client( val timeout = TimeUnit.SECONDS.toMillis(configuration.connectionCloseTimeoutInSeconds.toLong() * 2) val logger = KotlinLogging.logger(Client::class.java.simpleName) - AeronDriver.ensureStopped(configuration, logger, timeout) + AeronDriver.ensureStopped(configuration.copy(), logger, timeout) } /** @@ -144,7 +144,7 @@ open class Client( */ fun isRunning(configuration: Configuration): Boolean = runBlocking { val logger = KotlinLogging.logger(Client::class.java.simpleName) - AeronDriver.isRunning(configuration, logger) + AeronDriver.isRunning(configuration.copy(), logger) } init { @@ -567,9 +567,8 @@ open class Client( logger = logger ) - // Note: the pub/sub info is from the perspective of the SERVER val pubSub = handshakeConnection.pubSub - val logInfo = pubSub.reverseForClient().getLogInfo(logger.isDebugEnabled) + val logInfo = pubSub.getLogInfo(logger.isDebugEnabled) if (logger.isDebugEnabled) { logger.debug { "Creating new handshake to $logInfo" } @@ -791,7 +790,10 @@ open class Client( // we only need to run shutdown methods if there was a network outage or D/C if (!shutdownInProgress.value) { - this@Client.closeSuspending(false) + this@Client.closeSuspending( + closeEverything = false, + initiatedByClientClose = true, + initiatedByShutdown = false) } // we can now call connect again diff --git a/src/dorkbox/network/Server.kt b/src/dorkbox/network/Server.kt index d81e1744..0ea437c4 100644 --- a/src/dorkbox/network/Server.kt +++ b/src/dorkbox/network/Server.kt @@ -133,7 +133,7 @@ open class Server( val timeout = TimeUnit.SECONDS.toMillis(configuration.connectionCloseTimeoutInSeconds.toLong() * 2) val logger = KotlinLogging.logger(Server::class.java.simpleName) - AeronDriver.ensureStopped(configuration, logger, timeout) + AeronDriver.ensureStopped(configuration.copy(), logger, timeout) } /** @@ -145,7 +145,7 @@ open class Server( */ fun isRunning(configuration: ServerConfiguration): Boolean = runBlocking { val logger = KotlinLogging.logger(Server::class.java.simpleName) - AeronDriver.isRunning(configuration, logger) + AeronDriver.isRunning(configuration.copy(), logger) } init { diff --git a/src/dorkbox/network/aeron/AeronDriver.kt b/src/dorkbox/network/aeron/AeronDriver.kt index d78dd56f..ed51b893 100644 --- a/src/dorkbox/network/aeron/AeronDriver.kt +++ b/src/dorkbox/network/aeron/AeronDriver.kt @@ -139,8 +139,6 @@ class AeronDriver private constructor(config: Configuration, val logger: KLogger it.isRunning() } - // hacky, but necessary for multiple checks - configuration.contextDefined = false return running }