summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@jollamobile.com>2015-06-23 07:14:26 +1000
committerLorn Potter <lorn.potter@gmail.com>2015-08-06 19:36:59 +0000
commit51cf05c1bde7e10aa8b11c1de07542c37263ff5d (patch)
tree96182650afea1ddb5ae4aabc2ec15d55e4c389f0 /src/network
parentf43a2c20d3328b46abed42af379a0970d9404b54 (diff)
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>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index c1e837de7b..8ff6ee828d 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -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()