Add env variable to control bearer backend polling timers.

Scanning and updating networks can cause transmission jitters
when scanning every 10 seconds.
setting QT_BEARER_POLL_TIMEOUT, in milliseconds will set
polling timer for those bearer backends that require
polling, such as generic and windows.

Task-number: QTBUG-46015
Change-Id: I0338cd34ad78488ebef250a0114d17ce190434e8
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
This commit is contained in:
Lorn Potter 2015-06-23 07:14:26 +10:00 committed by Lorn Potter
parent f43a2c20d3
commit 51cf05c1bd

View File

@ -465,15 +465,18 @@ QList<QBearerEngine *> QNetworkConfigurationManagerPrivate::engines() const
void QNetworkConfigurationManagerPrivate::startPolling()
{
QMutexLocker locker(&mutex);
if(!pollTimer) {
if (!pollTimer) {
pollTimer = new QTimer(this);
pollTimer->setInterval(10000);
bool ok;
int interval = qgetenv("QT_BEARER_POLL_TIMEOUT").toInt(&ok);
if (!ok)
interval = 10000;//default 10 seconds
pollTimer->setInterval(interval);
pollTimer->setSingleShot(true);
connect(pollTimer, SIGNAL(timeout()), this, SLOT(pollEngines()));
}
if(pollTimer->isActive())
if (pollTimer->isActive())
return;
foreach (QBearerEngine *engine, sessionEngines) {
@ -482,6 +485,7 @@ void QNetworkConfigurationManagerPrivate::startPolling()
break;
}
}
performAsyncConfigurationUpdate();
}
void QNetworkConfigurationManagerPrivate::pollEngines()