moved ipc server to separated thread

This commit is contained in:
Igor Korsukov 2021-06-11 14:28:32 +02:00 committed by pereverzev+v
parent 213e3ab66e
commit 323f0ff6f2
3 changed files with 8 additions and 1 deletions

View file

@ -58,7 +58,11 @@ struct Msg
QString method;
QStringList args;
bool isValid() const { return type != MsgType::Undefined && !method.isEmpty(); }
<< << << < HEAD
bool isValid() const { return type != MsgType::Undefined && !method.isEmpty(); }
==
== ===bool isValid() const { return !method.isEmpty(); }
>> >> >> > moved ipc server to separated thread
};
struct Meta

View file

@ -85,6 +85,7 @@ bool IpcServer::listen(const QString& serverName)
});
socket->waitForReadyRead(TIMEOUT_MSEC);
QByteArray id = socket->readAll();
IncomingSocket inc;
@ -206,6 +207,7 @@ bool IpcServer::doSendToSocket(QLocalSocket* socket, const QByteArray& data)
m_lock->lock();
socket->write(data);
bool ok = socket->waitForBytesWritten(TIMEOUT_MSEC);
if (!ok) {
LOGE() << "failed write data to socket";

View file

@ -74,6 +74,7 @@ bool IpcSocket::connect(const QString& serverName)
}
m_socket->write(selfID().toUtf8());
ok = m_socket->waitForBytesWritten(TIMEOUT_MSEC);
if (!ok) {
LOGE() << "failed init socket";