From 5ec07b368bb948585a01a8a52a014a5bc29632bd Mon Sep 17 00:00:00 2001 From: Andrii Semkiv Date: Tue, 26 Nov 2024 17:35:34 +0100 Subject: [PATCH] QML Debug: Remove timer connection "optimization" Trying to connect ot host while there's another connection in progress leads to the latter being dropped and `QmlDebugConnection::connectionFailed` signal getting emitted (see `QmlDebugConnection::connectToHost` and `QmlDebugConnection::socketDisconnected`). This signal initiates the destruction of the connection itself (see `QmlDebugConnectionManager::qmlDebugConnectionFailed`). Fixes: QTCREATORBUG-32062 Change-Id: Ibf4a33ac87db0d62d81177c508ae68db337e9f82 Reviewed-by: hjk Reviewed-by: Marcus Tillmanns --- src/libs/qmldebug/qmldebugconnectionmanager.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/libs/qmldebug/qmldebugconnectionmanager.cpp b/src/libs/qmldebug/qmldebugconnectionmanager.cpp index eb706b3dbbb..ddd8995c5af 100644 --- a/src/libs/qmldebug/qmldebugconnectionmanager.cpp +++ b/src/libs/qmldebug/qmldebugconnectionmanager.cpp @@ -71,15 +71,6 @@ void QmlDebugConnectionManager::connectToTcpServer() // If the previous connection failed, recreate it. createConnection(); m_connection->connectToHost(m_server.host(), port16(m_server)); - } else if (m_numRetries < 3 - && m_connection->socketState() != QAbstractSocket::ConnectedState) { - // If we don't get connected in the first retry interval, drop the socket and try - // with a new one. On some operating systems (maxOS) the very first connection to a - // TCP server takes a very long time to get established and this helps. - // On other operating systems (windows) every connection takes forever to get - // established. So, after tearing down and rebuilding the socket twice, just - // keep trying with the same one. - m_connection->connectToHost(m_server.host(), port16(m_server)); } // Else leave it alone and wait for hello. } else { // On final timeout, clear the connection.