summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Petersson <martin.petersson@nokia.com>2011-02-18 10:07:12 (GMT)
committerMartin Petersson <martin.petersson@nokia.com>2011-02-18 10:07:12 (GMT)
commitc6d5ca21bc56b102d3edda21a7658b28cefe8e23 (patch)
treeadf898039f718ce48cf38e522a27bda785de7f6c /src
parent2576f3b44258848ccb2fc345f53eec22ec8fc0d5 (diff)
downloadQt-c6d5ca21bc56b102d3edda21a7658b28cefe8e23.zip
Qt-c6d5ca21bc56b102d3edda21a7658b28cefe8e23.tar.gz
Qt-c6d5ca21bc56b102d3edda21a7658b28cefe8e23.tar.bz2
QNativeSocketEngine: Only do SIO_UDP_CONNRESET for UDP sockets
Reviewed-by: Markus Goetz
Diffstat (limited to 'src')
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index 76c9158..ac2aa87 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -337,15 +337,17 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
}
#if !defined(Q_OS_WINCE)
- // enable new behavior using
- // SIO_UDP_CONNRESET
- DWORD dwBytesReturned = 0;
- int bNewBehavior = 1;
- if (::WSAIoctl(socket, SIO_UDP_CONNRESET, &bNewBehavior, sizeof(bNewBehavior),
- NULL, 0, &dwBytesReturned, NULL, NULL) == SOCKET_ERROR) {
- // not to worry isBogusUdpReadNotification() should handle this otherwise
- int err = WSAGetLastError();
- WS_ERROR_DEBUG(err);
+ if (socketType == QAbstractSocket::UdpSocket) {
+ // enable new behavior using
+ // SIO_UDP_CONNRESET
+ DWORD dwBytesReturned = 0;
+ int bNewBehavior = 1;
+ if (::WSAIoctl(socket, SIO_UDP_CONNRESET, &bNewBehavior, sizeof(bNewBehavior),
+ NULL, 0, &dwBytesReturned, NULL, NULL) == SOCKET_ERROR) {
+ // not to worry isBogusUdpReadNotification() should handle this otherwise
+ int err = WSAGetLastError();
+ WS_ERROR_DEBUG(err);
+ }
}
#endif