mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
fix keepalive being multiplied in server timeout (#4663)
* fix keepalive being multiplied in server timeout a timeout happened after the client not receiving anything for keepalive * keepalive * maxtimeout (5 * 5 * 10) seconds instead of what you'd expect, it now only uses keepalive once instead of twice this means it should now take 50 seconds to time out when disconnected * change timeout to 15 seconds instead change time between pings to 3 from 5 seconds change timout to 5 from 10 repeats
This commit is contained in:
parent
b5305aa5e4
commit
2f100f2ba3
3 changed files with 3 additions and 4 deletions
|
|
@ -541,10 +541,9 @@ void RemoteClient::ping()
|
|||
}
|
||||
}
|
||||
|
||||
int keepalive = SettingsCache::instance().getKeepAlive();
|
||||
int maxTime = timeRunning - lastDataReceived;
|
||||
emit maxPingTime(maxTime, maxTimeout);
|
||||
if (maxTime >= (keepalive * maxTimeout)) {
|
||||
if (maxTime >= maxTimeout) {
|
||||
disconnectFromServer();
|
||||
emit serverTimeout();
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue