Set localAddress and localPort on socket binding.
authorRobin Burchell <robin.burchell@collabora.com>
Mon, 24 Oct 2011 16:36:23 +0000 (18:36 +0200)
committerSergio Ahumada <sergio.ahumada@nokia.com>
Mon, 31 Oct 2011 19:24:46 +0000 (20:24 +0100)
This should have always been the case, as it simply makes sense, but the
upcoming moving of binding to QAbstractSocket will require this for autotesting.

Change-Id: Ieef70196616227e7914c76fff5388a4068c36efb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
src/network/socket/qnativesocketengine_unix.cpp
src/network/socket/qnativesocketengine_win.cpp

index 246b5ed..ae7e239 100644 (file)
@@ -536,6 +536,9 @@ bool QNativeSocketEnginePrivate::nativeBind(const QHostAddress &address, quint16
         return false;
     }
 
+    localPort = port;
+    localAddress = address;
+
 #if defined (QNATIVESOCKETENGINE_DEBUG)
     qDebug("QNativeSocketEnginePrivate::nativeBind(%s, %i) == true",
            address.toString().toLatin1().constData(), port);
index 67a9a21..4be930b 100644 (file)
@@ -768,6 +768,9 @@ bool QNativeSocketEnginePrivate::nativeBind(const QHostAddress &a, quint16 port)
         return false;
     }
 
+    localPort = port;
+    localAddress = address;
+
 #if defined (QNATIVESOCKETENGINE_DEBUG)
     qDebug("QNativeSocketEnginePrivate::nativeBind(%s, %i) == true",
            address.toString().toLatin1().constData(), port);