mirror of
https://github.com/g4klx/DAPNETGateway.git
synced 2026-08-26 12:32:45 -04:00
Revert old backoff code
This commit is contained in:
parent
fa9e6731d0
commit
5773edfa9b
1 changed files with 0 additions and 10 deletions
|
|
@ -407,26 +407,16 @@ void CDAPNETGateway::sendMessages()
|
|||
}
|
||||
|
||||
bool CDAPNETGateway::recover()
|
||||
/*
|
||||
Recovery now uses an increasing reconnect holdoff time to prevent
|
||||
DoS-like reconnect attempts to the core server.
|
||||
*/
|
||||
{
|
||||
const unsigned int backoff[] = {2000u, 4000u, 8000u, 10000u, 20000u, 60000u, 120000u, 240000u, 480000u, 600000u};
|
||||
int i=0;
|
||||
|
||||
for (;;) {
|
||||
m_dapnetNetwork->close();
|
||||
CThread::sleep(backoff[i]);
|
||||
|
||||
bool ok = m_dapnetNetwork->open();
|
||||
if (ok) {
|
||||
ok = m_dapnetNetwork->login();
|
||||
if (ok)
|
||||
return true;
|
||||
}
|
||||
if (i < 9)
|
||||
i++;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue