void Client::read() { connectionMutex.lock(); while (socket->bytesAvailable() > 0) { try { connection->read(); } catch (IOException &e) { lastError = e.toString(); Utilities::logData("read(): There was an IO Exception: " + lastError); connectionClosed(); showStatus(lastError + " Retrying in 10 seconds.."); break; } catch (ProtocolException &e) { lastError = e.toString(); Utilities::logData("read(): There was a Protocol Exception: " + lastError); connectionClosed(); showStatus("Protocol Exception. Retrying in 10 seconds..."); break; } } connectionMutex.unlock(); }