fix regression in ping strategy
This commit is contained in:
parent
8df97067bb
commit
f982885d2e
|
@ -267,7 +267,7 @@ public class ConnectionPool {
|
||||||
final long lastReceived = connection.getLastPacketReceived();
|
final long lastReceived = connection.getLastPacketReceived();
|
||||||
final long lastSent = connection.getLastPingSent();
|
final long lastSent = connection.getLastPingSent();
|
||||||
final long msToNextPing =
|
final long msToNextPing =
|
||||||
(Math.max(lastReceived, lastSent) + Config.PING_MAX_INTERVAL)
|
(Math.max(lastReceived, lastSent) + Config.PING_MAX_INTERVAL * 1000)
|
||||||
- SystemClock.elapsedRealtime();
|
- SystemClock.elapsedRealtime();
|
||||||
final int pingTimeout =
|
final int pingTimeout =
|
||||||
lowPingTimeoutMode.contains(account.address)
|
lowPingTimeoutMode.contains(account.address)
|
||||||
|
@ -280,8 +280,7 @@ public class ConnectionPool {
|
||||||
Log.d(Config.LOGTAG, account.address + ": ping timeout");
|
Log.d(Config.LOGTAG, account.address + ": ping timeout");
|
||||||
this.reconnectAccount(connection);
|
this.reconnectAccount(connection);
|
||||||
} else {
|
} else {
|
||||||
final int secs = (int) (pingTimeoutIn / 1000);
|
this.scheduleWakeUpCall(Ints.saturatedCast(pingTimeoutIn / 1000));
|
||||||
this.scheduleWakeUpCall(secs);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pingCandidates.add(connection);
|
pingCandidates.add(connection);
|
||||||
|
|
Loading…
Reference in a new issue