PDA

View Full Version : Reading from QNetworkReply working in another thread



ultr
9th October 2010, 23:08
I send a QNetworkRequest from a QThread which creates a QNetworkReply there.
Then I try to read() this reply from the main thread.

Of course read()ing causes data removal from QNetworkReply's buffer.

But it seems such reads collide with the thread writing incoming data into the QNetworkReply's buffer. This leads to buffer's data loss and even crashes (malloc() related).

How can I solve this?

squidge
9th October 2010, 23:54
Do it in one thread.

Don't try and use networking across multiple threads. There's really no need for it.