Unsolved why QTcpSocket.read() will block?
-
I'm using the class QTcpSocket to read write data on client mode, but the function QTcpSocket.read() will block there when continues to reading! why?
-
Hi!
Probably because there is no data to read yet.
How and when do you call read()? Is the socket connected?
You should connect the QTcpSocket::readyRead() signal to a slot and read the data in that slot.
See http://doc.qt.io/qt-5/qtnetwork-fortuneclient-example.html