How i can make QSocketTCP blocking without using waitForReadyRead()
Thank you in advance.
How i can make QSocketTCP blocking without using waitForReadyRead()
Thank you in advance.
I am seriously wondering if you are a troll.
You are now at your fifth posting for QTcpSocket, have not replied to any of the answers given to any of them. Probably have not even read them since you keep wrting QSocketTCP.
I am sure when I return later today I will see yet another QSocketTCP thread, asking yet another question that could have easily been answered by reading the documentation and a bit of experiementation.
Cheers,
_
Sorry,
I assure you that your answers were very helpful for me. because I'm still a beginner at qt level.
Then you should at least indicate in the threads you start when you have all the answers you need.
Regarding your current question: waitForSignalName is the way to do blocking operations with an otherwise non-blocking class.
Cheers,
_
but I'm looking for how to block QSocketTCP without using waitForSignalName
If you only want to do pseudo blocking you can do something like this
Qt Code:
QEventLoop loop; connect(socket, SIGNAL(readyRead()), &loop, SLOT(quit())); loop.exec();To copy to clipboard, switch view to plain text mode
But be aware that nested event loops can be tricky.
Cheers,
_
Thank you, your answer has been very useful.
Bookmarks