Implement preliminary login backoff timer

This commit is contained in:
phl0 2018-08-23 14:07:04 +02:00
parent fd609b0eb1
commit cb9787b2cd
No known key found for this signature in database
GPG key ID: 48EA1E640798CA9A

View file

@ -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) {