summaryrefslogtreecommitdiffstats
path: root/src/network/bearer/qnetworkconfiguration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/bearer/qnetworkconfiguration.cpp')
-rw-r--r--src/network/bearer/qnetworkconfiguration.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp
index 533a27357c..f1619ab7c0 100644
--- a/src/network/bearer/qnetworkconfiguration.cpp
+++ b/src/network/bearer/qnetworkconfiguration.cpp
@@ -326,6 +326,44 @@ bool QNetworkConfiguration::isValid() const
}
/*!
+ \since 5.9
+
+ Returns the connect timeout of this configuration.
+
+ \sa setConnectTimeout
+*/
+int QNetworkConfiguration::connectTimeout() const
+{
+ if (!d)
+ return QNetworkConfigurationPrivate::DefaultTimeout;
+ QMutexLocker locker(&d->mutex);
+ return d->timeout;
+}
+
+/*!
+ \since 5.9
+
+ Sets the connect timeout of this configuration to \a timeout.
+ This allows control of the timeout used by \c QAbstractSocket
+ to establish a connection.
+
+ \warning This will have no effect if the bearer plugin doesn't have
+ the CanStartAndStopInterfaces capability.
+
+ Returns true if succeeded.
+
+ \sa connectTimeout
+*/
+bool QNetworkConfiguration::setConnectTimeout(int timeout)
+{
+ if (!d)
+ return false;
+ QMutexLocker locker(&d->mutex);
+ d->timeout = timeout;
+ return true;
+}
+
+/*!
Returns the current state of the configuration.
*/
QNetworkConfiguration::StateFlags QNetworkConfiguration::state() const