forked from qt-creator/qt-creator
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 <hjk@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -71,15 +71,6 @@ void QmlDebugConnectionManager::connectToTcpServer()
|
|||||||
// If the previous connection failed, recreate it.
|
// If the previous connection failed, recreate it.
|
||||||
createConnection();
|
createConnection();
|
||||||
m_connection->connectToHost(m_server.host(), port16(m_server));
|
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 leave it alone and wait for hello.
|
||||||
} else {
|
} else {
|
||||||
// On final timeout, clear the connection.
|
// On final timeout, clear the connection.
|
||||||
|
Reference in New Issue
Block a user