From ac4afd3d503c36fca05189ce3f7d07eae930ac4e Mon Sep 17 00:00:00 2001 From: Robinson Date: Mon, 4 Apr 2022 19:39:05 +0200 Subject: [PATCH] Fixed seconds -> MS for RMI ping --- src/dorkbox/network/ping/PingManager.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dorkbox/network/ping/PingManager.kt b/src/dorkbox/network/ping/PingManager.kt index 58d9d0b9..e085ca6e 100644 --- a/src/dorkbox/network/ping/PingManager.kt +++ b/src/dorkbox/network/ping/PingManager.kt @@ -23,6 +23,7 @@ import dorkbox.network.connection.Connection import dorkbox.network.rmi.ResponseManager import kotlinx.coroutines.CoroutineScope import mu.KLogger +import java.util.concurrent.* /** * How to handle ping messages @@ -79,7 +80,7 @@ internal class PingManager { } // ALWAYS cancel the ping after 30 seconds - responseManager.cancelRequest(actionDispatch, pingTimeoutSeconds.toLong(), id, logger) { + responseManager.cancelRequest(actionDispatch, TimeUnit.SECONDS.toMillis(pingTimeoutSeconds.toLong()), id, logger) { // kill the callback, since we are now "cancelled". If there is a race here (and the response comes at the exact same time) // we don't care since either it will be null or it won't (if it's not null, it will run the callback) result = null