WinRT: Early return in case of network error
Change-Id: I7c410732f41b86f39b41fd1dccd07815e5ca4e45 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
This commit is contained in:
parent
8c7d6b94d5
commit
372e3c8592
@ -1224,21 +1224,21 @@ void QNativeSocketEnginePrivate::handleConnectionEstablished(IAsyncAction *actio
|
||||
case 0x8007274c: // A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
|
||||
setError(QAbstractSocket::NetworkError, ConnectionTimeOutErrorString);
|
||||
socketState = QAbstractSocket::UnconnectedState;
|
||||
break;
|
||||
return;
|
||||
case 0x80072751: // A socket operation was attempted to an unreachable host.
|
||||
setError(QAbstractSocket::HostNotFoundError, HostUnreachableErrorString);
|
||||
socketState = QAbstractSocket::UnconnectedState;
|
||||
break;
|
||||
return;
|
||||
case 0x8007274d: // No connection could be made because the target machine actively refused it.
|
||||
setError(QAbstractSocket::ConnectionRefusedError, ConnectionRefusedErrorString);
|
||||
socketState = QAbstractSocket::UnconnectedState;
|
||||
break;
|
||||
return;
|
||||
default:
|
||||
if (FAILED(hr)) {
|
||||
setError(QAbstractSocket::UnknownSocketError, UnknownSocketErrorString);
|
||||
socketState = QAbstractSocket::UnconnectedState;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// The callback might be triggered several times if we do not cancel/reset it here
|
||||
|
Loading…
Reference in New Issue
Block a user