PDA

View Full Version : QTcpServer/socket readall



jwz104
6th August 2016, 17:07
I want to send an file over a tcp socket with base64. But when I do readAll I receive it in multiple strings.
I know that there are a lot of topics about this but what is the best way to receive the complete data?
Also I want to know what the best way is to send an file, with the file I also have to send some data(String). Thats the reason I use base64.

Does someone has an example of how I can receive complete data?

Lesiok
6th August 2016, 17:51
With TCP socket data are transfered in chunks. Every readAll gives You one chunk of data. You must defien some protocol that allows to recognize the beginning and end of data.

anda_skoa
6th August 2016, 23:47
We've already covered that, haven't we?
http://www.qtcentre.org/threads/65782-Sending-large-base64-string-over-qtcpsocket

Cheers,
_