diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/network/socket/qnativesocketengine_win.cpp | 20 |
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 |