UI: ControlWorker: Handle errorOccurred() signal.

This commit is contained in:
Nodir Temirkhodjaev 2021-05-14 16:00:27 +03:00
parent e063421819
commit 76dd73a728
2 changed files with 6 additions and 0 deletions

View File

@ -88,6 +88,11 @@ void ControlWorker::setupForAsync()
socket()->setParent(this);
connect(socket(), &QLocalSocket::disconnected, this, &ControlWorker::disconnected);
connect(socket(), &QLocalSocket::errorOccurred, this,
[&](QLocalSocket::LocalSocketError socketError) {
qWarning() << "Client error:" << id() << socketError << errorString();
abort();
});
connect(socket(), &QLocalSocket::readyRead, this, &ControlWorker::processRequest);
}

View File

@ -24,6 +24,7 @@ public:
QLocalSocket *socket() const { return m_socket; }
int id() const;
QString errorString() const;
void setupForAsync();