From 4967faf212343cdbcf4c455ce39728a1967ea287 Mon Sep 17 00:00:00 2001 From: Robinson Date: Sat, 2 Apr 2022 13:24:26 +0200 Subject: [PATCH] Connection timeouts should use currentTimeMillis (not nanoTime!) --- src/dorkbox/network/connection/Connection.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dorkbox/network/connection/Connection.kt b/src/dorkbox/network/connection/Connection.kt index d1b01967..a3908b07 100644 --- a/src/dorkbox/network/connection/Connection.kt +++ b/src/dorkbox/network/connection/Connection.kt @@ -296,14 +296,14 @@ open class Connection(connectionParameters: ConnectionParams<*>) { } /** - * We must account for network blips. They blips will be recovered by aeron, but we want to make sure that we are actually + * We must account for network blips. The blips will be recovered by aeron, but we want to make sure that we are actually * disconnected for a set period of time before we start the close process for a connection * * @return `true` if this connection has been closed via aeron */ fun isClosedViaAeron(): Boolean { // we ONLY want to actually, legit check, 1 time every XXX ms. - val now = System.nanoTime() + val now = System.currentTimeMillis() if (now - connectionLastCheckTime < connectionCheckIntervalInMS) { // we haven't waited long enough for another check. always return false (true means we are closed)