Fixed client handshake timeout

This commit is contained in:
Robinson 2022-03-15 10:27:21 +01:00
parent 9e52c398d6
commit 67bf5e2b21
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C

View File

@ -212,7 +212,7 @@ internal class ClientHandshake<CONNECTION: Connection>(
val subscription = handshakeConnection.subscription
val pollIdleStrategy = endPoint.pollIdleStrategyHandShake
val timoutInNanos = TimeUnit.SECONDS.toMillis(connectionTimeoutSec.toLong())
val timoutInNanos = TimeUnit.SECONDS.toNanos(connectionTimeoutSec.toLong())
var startTime = System.nanoTime()
while (timoutInNanos == 0L || System.nanoTime() - startTime < timoutInNanos) {
// NOTE: regarding fragment limit size. Repeated calls to '.poll' will reassemble a fragment.