Fixed client connect issue when trying to shutdown

This commit is contained in:
Robinson 2022-06-14 19:24:48 +02:00
parent 0d01b8d303
commit 5dd9f50a0c
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C

View File

@ -421,7 +421,7 @@ open class Client<CONNECTION : Connection>(
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(