diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2010-08-05 10:48:44 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2010-09-01 12:24:46 (GMT) |
commit | 75a56ce44908eb14ef058d111129ef3d285c5364 (patch) | |
tree | d59c138a649140a93ff86b1987e98d1a2e8a322c /src/network/socket/qhttpsocketengine.cpp | |
parent | 8082ee277b44a158ce87d646e0d2c1d11e7d8348 (diff) | |
download | Qt-75a56ce44908eb14ef058d111129ef3d285c5364.zip Qt-75a56ce44908eb14ef058d111129ef3d285c5364.tar.gz Qt-75a56ce44908eb14ef058d111129ef3d285c5364.tar.bz2 |
Add QUdpSocket::setMulticastInterface() and ::multicastInterface()
This API allows the programmer to set/query the outgoing interface for
multicast packets for the socket. Both functions need an initialized
socket to work.
Autotest updated to test setting each interface in the system as the
multicast interface for IPv4 and IPv6 UDP sockets.
Diffstat (limited to 'src/network/socket/qhttpsocketengine.cpp')
-rw-r--r-- | src/network/socket/qhttpsocketengine.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index e467df8..cb0e296 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -45,6 +45,7 @@ #include "qurl.h" #include "qhttp.h" #include "qelapsedtimer.h" +#include "qnetworkinterface.h" #if !defined(QT_NO_NETWORKPROXY) && !defined(QT_NO_HTTP) #include <qdebug.h> @@ -255,6 +256,18 @@ bool QHttpSocketEngine::leaveMulticastGroup(const QHostAddress &, return false; } +QNetworkInterface QHttpSocketEngine::multicastInterface() const +{ + return QNetworkInterface(); +} + +bool QHttpSocketEngine::setMulticastInterface(const QNetworkInterface &) +{ + setError(QAbstractSocket::UnsupportedSocketOperationError, + QLatin1String("Operation on socket is not supported")); + return false; +} + qint64 QHttpSocketEngine::readDatagram(char *, qint64, QHostAddress *, quint16 *) { |