From 7908ef2593a49a26a18b279a719238cab56f2d38 Mon Sep 17 00:00:00 2001 From: Robinson Date: Mon, 26 Jul 2021 20:17:03 +0200 Subject: [PATCH] Fixed comments, tweaked shutdown delay --- src/dorkbox/network/connection/Connection.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dorkbox/network/connection/Connection.kt b/src/dorkbox/network/connection/Connection.kt index a8bb2a7c..c9c4e2b2 100644 --- a/src/dorkbox/network/connection/Connection.kt +++ b/src/dorkbox/network/connection/Connection.kt @@ -341,8 +341,8 @@ open class Connection(connectionParameters: ConnectionParams<*>) { suspend fun close() { // there are 2 ways to call close. // MANUALLY - // when a connection is disconnected via a timeout/expire. - // the compareAndSet is used to make sure that if we call close() MANUALLY, when the auto-cleanup/disconnect is called -- it doesn't + // When a connection is disconnected via a timeout/expire. + // the compareAndSet is used to make sure that if we call close() MANUALLY, (and later) when the auto-cleanup/disconnect is called -- it doesn't // try to do it again. // the server 'handshake' connection info is cleaned up with the disconnect via timeout/expire. @@ -357,7 +357,7 @@ open class Connection(connectionParameters: ConnectionParams<*>) { // we do not want to close until AFTER all publications have been sent. Calling this WITHOUT waiting will instantly stop everything // we want a timeout-check, otherwise this will run forever while (messagesInProgress.value != 0 && System.currentTimeMillis() < closeTimeoutTime) { - delay(100) + delay(50) } // on close, we want to make sure this file is DELETED!