View Full Version : QtcpSocket Data sent

6th June 2014, 12:36
Hi ,

i'm using QtcpSocket, i send 36250 byte, but i receive just 8182. Please helpe me.

this my function iSizeRead = m_pSocket->read((char*)szBuffer,36250);

Thank you in advance.

6th June 2014, 13:25
Read again when more data arrives.

6th June 2014, 13:27
read() is meant to be used asynchronously. That is, you need to wait for the readyRead() signal to read what data is available, then return to the event loop and wait for more. Check out the documentation of QAbstractSocket and the various network examples to learn how to do it. Also, http://blog.stephencleary.com/2009/04/tcpip-net-sockets-faq.html explains why you cannot expect the received data to be split in the same blocks as the sent data. Finally, search this forum as your question has been answered multiple times.

9th June 2014, 11:07
Thank you i find the answer in the documentation, i need to wait id data is not completed.