diff --git a/src/dorkbox/network/Client.kt b/src/dorkbox/network/Client.kt index c1d3d58a..532fbc2c 100644 --- a/src/dorkbox/network/Client.kt +++ b/src/dorkbox/network/Client.kt @@ -493,7 +493,8 @@ open class Client( aeronDriver.start() // short delay, since it failed we want to limit the retry rate to something slower than "as fast as the CPU can do it" - delay(500) + // we also want to go at SLIGHTLY slower that the aeron driver timeout frequency, this way - if there are connection or handshake issues, the server has the chance to expire the connections. + delay(aeronDriver.driverTimeout()+1) if (logger.isTraceEnabled) { logger.trace(e) { "Unable to connect to '$remoteAddressString', retrying..." } } else { diff --git a/src/dorkbox/network/aeron/AeronDriver.kt b/src/dorkbox/network/aeron/AeronDriver.kt index 5823ef82..9923ef0d 100644 --- a/src/dorkbox/network/aeron/AeronDriver.kt +++ b/src/dorkbox/network/aeron/AeronDriver.kt @@ -488,6 +488,14 @@ class AeronDriver( } } + /** + * @return the aeron driver timeout + */ + fun driverTimeout(): Long { + return context.driverTimeout + } + + /** * @return the aeron media driver log file for a specific publication. This should be removed when a publication is closed (but is not always!) */