QtNetwork: Better detection of connection failures on Windows
authorMartin Petersson <Martin.Petersson@nokia.com>
Thu, 12 Jul 2012 10:52:17 +0000 (12:52 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 30 Jul 2012 08:43:50 +0000 (10:43 +0200)
commit4d38a3b2dabda9c89c1b257820911aa987f04d2b
tree46c0e5697e204f43f49804208e5cf8370afdb5c5
parentada38c75cccb33947107212c08e7b080e6b54f84
QtNetwork: Better detection of connection failures on Windows

If the error code from WSAConnect is WSAEWOULDBLOCK, then the
operation proceeds but the outcome is not known at that time. We then
check SO_ERROR's value to detect errors. But if that call returns 0
this could indicate that the value is still not know. In this case
we try one more time to increase the chance of getting the correct
value.

This fixed the tst_QNetworkReply::getFromUnreachableIp auto test
on Windows.

Change-Id: I25008aca062b2f823e3d93ebb0ae456d7e4a6ecc
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
src/network/socket/qnativesocketengine_win.cpp