From 5dd9f50a0c71de9ee225c718e278335689030cdc Mon Sep 17 00:00:00 2001 From: Robinson Date: Tue, 14 Jun 2022 19:24:48 +0200 Subject: [PATCH] Fixed client connect issue when trying to shutdown --- src/dorkbox/network/Client.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dorkbox/network/Client.kt b/src/dorkbox/network/Client.kt index 2e68eb93..d24ba9d4 100644 --- a/src/dorkbox/network/Client.kt +++ b/src/dorkbox/network/Client.kt @@ -421,7 +421,7 @@ open class Client( val handshakeTimeout = 5 val timoutInNanos = TimeUnit.SECONDS.toNanos(connectionTimeoutSec.toLong()) val startTime = System.nanoTime() - while (timoutInNanos == 0L || System.nanoTime() - startTime < timoutInNanos) { + while (!isShutdown() && (timoutInNanos == 0L || System.nanoTime() - startTime < timoutInNanos)) { try { val handshakeConnection = if (autoChangeToIpc) { buildIpcHandshake(