diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp index 173221dec0..1c68b28784 100644 --- a/src/network/socket/qnativesocketengine_winrt.cpp +++ b/src/network/socket/qnativesocketengine_winrt.cpp @@ -380,8 +380,10 @@ int QNativeSocketEngine::accept() Q_CHECK_STATE(QNativeSocketEngine::accept(), QAbstractSocket::ListeningState, -1); Q_CHECK_TYPE(QNativeSocketEngine::accept(), QAbstractSocket::TcpSocket, -1); - if (d->socketDescriptor == -1 || d->pendingConnections.isEmpty()) + if (d->socketDescriptor == -1 || d->pendingConnections.isEmpty()) { + d->setError(QAbstractSocket::TemporaryError, QNativeSocketEnginePrivate::TemporaryErrorString); return -1; + } // Start processing incoming data if (d->socketType == QAbstractSocket::TcpSocket) {