qlocalsocket

Qt 5.2: QLocalServer receiving duplicated readyRead signals

半城伤御伤魂 提交于 2020-01-05 04:47:05
问题 I'm puzzled with a problem designing a simple QLocalServer-QLocalSocket IPC system. The QLocalServer waits for a new connection and connect the signals to the proper slots. void CommandProcessor::onNewConnection() { QLocalSocket* pLocal = _server->nextPendingConnection(); connect(pLocal,SIGNAL(disconnected()),this,SLOT(onSocketDisconnected())); connect(pLocal,SIGNAL(readyRead()),this,SLOT(onSocketReadyRead())); connect(pLocal,SIGNAL(error(QLocalSocket::LocalSocketError)),this, SLOT

How can i clear QLocalSocket?

房东的猫 提交于 2019-12-12 04:21:46
问题 I've a problem in clearing the QLocalSocket . Now I'm sending & receiving the image data through QLocalServer/QLocalSocket . But in receiving program , memory increases heavily because of piled image data in memory. so, I want to clean up the socket when the data was read. but it seems there is no function in QLocalSocket reference. How can I clear the socket? 回答1: It looks like the only way to avoid this behaviour is to close socket (not named pipe server) and to open it again once you have

Qt4.5: Using event-loop based localsocket before app.exec

冷暖自知 提交于 2019-12-07 13:28:23
问题 I'm facing a practical problem with Qt. I'm using a class that communicates with QLocalSocket to another process (pipes/unix sockets) and I need to do that communication before other events occur, that is before app.exec() starts (or more precisely,as soon as app starts). The class that I'm using needs an eventloop so it does not work if I call the class methods before an event loop is started. There is any way to start something when the event loop is ready? I thought of making a hidden

Qt4.5: Using event-loop based localsocket before app.exec

喜你入骨 提交于 2019-12-05 20:53:54
I'm facing a practical problem with Qt. I'm using a class that communicates with QLocalSocket to another process (pipes/unix sockets) and I need to do that communication before other events occur, that is before app.exec() starts (or more precisely,as soon as app starts). The class that I'm using needs an eventloop so it does not work if I call the class methods before an event loop is started. There is any way to start something when the event loop is ready? I thought of making a hidden event-only window and do my duties in the hidden window constructor, and stablish this window as toplevel.