mirror of
https://github.com/g4klx/DAPNETGateway.git
synced 2026-08-26 12:32:45 -04:00
Implement preliminary login backoff timer
This commit is contained in:
parent
fd609b0eb1
commit
cb9787b2cd
1 changed files with 12 additions and 2 deletions
|
|
@ -278,8 +278,18 @@ int CDAPNETGateway::run()
|
|||
}
|
||||
|
||||
bool ok = m_dapnetNetwork->read();
|
||||
if (!ok)
|
||||
recover();
|
||||
if (!ok) {
|
||||
int i = 0;
|
||||
const unsigned int backoff[] = {
|
||||
2000U, 4000U, 8000U, 10000U, 20000U,
|
||||
60000U, 120000U, 240000U, 480000U, 600000U };
|
||||
while (i<10) {
|
||||
CThread::sleep(backoff[i]);
|
||||
recover();
|
||||
if (i < 9)
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
CPOCSAGMessage* message = m_dapnetNetwork->readMessage();
|
||||
if (message != NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue