QmlDebugClient: Check for gotHello to determine if connection is open

The isConnected() method was misleading as it only checked for the
network socket to be connected. Sending data before the hello message
arrives is a pretty stupid idea and the debug clients need a way to
detect that. The new isOpen method stresses that it's about the
logical protocol, not the network socket.

Change-Id: I84f093d91d7a21d20a8f3d14730c9f189ec35bde
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-05-05 18:01:02 +02:00
parent 10252364bb
commit ba5c136a6d
5 changed files with 33 additions and 35 deletions

View File

@@ -243,7 +243,7 @@ void QmlProfilerClientManager::connectToClient()
bool QmlProfilerClientManager::isConnected() const
{
return d->connection && d->connection->isConnected();
return d->connection && d->connection->isOpen();
}
void QmlProfilerClientManager::disconnectClient()
@@ -260,7 +260,7 @@ void QmlProfilerClientManager::tryToConnect()
{
++d->connectionAttempts;
if (d->connection && d->connection->isConnected()) {
if (d->connection && d->connection->isOpen()) {
d->connectionTimer.stop();
d->connectionAttempts = 0;
} else if (d->connectionAttempts == 50) {