summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qnativesocketengine_win.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-03-11 18:58:29 -0700
committerThiago Macieira <thiago.macieira@intel.com>2015-08-22 22:26:47 +0000
commit452924c6ffc9624062bfb83eda8499044cc4719f (patch)
treeafb5bb1f7c9b306ece7efe0fe1ee9761b80ba5bb /src/network/socket/qnativesocketengine_win.cpp
parent2c64e05d497b460f95cd39ea20c4e805b2c8c402 (diff)
QNativeSocketEngine Unix: do the same as for Windows
Change-Id: Iee8cbc07c4434ce9b560ffff13ca9d9858cf7111 Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network/socket/qnativesocketengine_win.cpp')
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp32
1 files changed, 6 insertions, 26 deletions
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index aecae40a44..5e198098df 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -278,32 +278,6 @@ static void convertToLevelAndOption(QNativeSocketEngine::SocketOption opt,
/*! \internal
- Sets the port and address to a sockaddr. Requires that sa point to the IPv6 struct if the address is IPv6.
-*/
-void QNativeSocketEnginePrivate::setPortAndAddress(quint16 port, const QHostAddress &address, qt_sockaddr *aa, QT_SOCKLEN_T *sockAddrSize)
-{
- if (address.protocol() == QAbstractSocket::IPv6Protocol
- || address.protocol() == QAbstractSocket::AnyIPProtocol
- || socketProtocol == QAbstractSocket::IPv6Protocol
- || socketProtocol == QAbstractSocket::AnyIPProtocol) {
- memset(&aa->a6, 0, sizeof(qt_sockaddr_in6));
- aa->a6.sin6_family = AF_INET6;
- aa->a6.sin6_scope_id = address.scopeId().toUInt();
- WSAHtons(socketDescriptor, port, &aa->a6.sin6_port);
- Q_IPV6ADDR tmp = address.toIPv6Address();
- memcpy(&aa->a6.sin6_addr, &tmp, sizeof(tmp));
- *sockAddrSize = sizeof(qt_sockaddr_in6);
- } else {
- memset(&aa->a, 0, sizeof(sockaddr_in));
- aa->a4.sin_family = AF_INET;
- WSAHtons(socketDescriptor, port, &aa->a4.sin_port);
- WSAHtonl(socketDescriptor, address.toIPv4Address(), &aa->a4.sin_addr.s_addr);
- *sockAddrSize = sizeof(sockaddr_in);
- }
-}
-
-/*! \internal
-
*/
static inline QAbstractSocket::SocketType qt_socket_getType(qintptr socketDescriptor)
{
@@ -348,6 +322,12 @@ static inline int qt_socket_getMaxMsgSize(qintptr socketDescriptor)
# define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12)
#endif
+// inline on purpose
+inline uint QNativeSocketEnginePrivate::scopeIdFromString(const QString &scopeid)
+{
+ return scopeid.toUInt();
+}
+
bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType socketType, QAbstractSocket::NetworkLayerProtocol &socketProtocol)
{