moved ipc server to separated thread
This commit is contained in:
parent
213e3ab66e
commit
323f0ff6f2
3 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue