PDA

View Full Version : QtcpSocket Data sent



hassinoss
6th June 2014, 11: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.

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

yeye_olive
6th June 2014, 12: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.

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