Hello,
With a "classic" network behaviour, a read() function must be -sometimes- called many times because packets aren't delivered in one chunk
eg:
int siz=2048;
int len=siz;
while(len>0)
{
siz = read(socket, len); // returns number of bytes read
if (siz==0)
return 1;
len-=siz;
}
int siz=2048;
int len=siz;
while(len>0)
{
siz = read(socket, len); // returns number of bytes read
if (siz==0)
return 1;
len-=siz;
}
To copy to clipboard, switch view to plain text mode
Now, with QTcpSocket, do I have the same "problem" or a simple
sck.read(socket, len);
sck.read(socket, len);
To copy to clipboard, switch view to plain text mode
is enough to get all the data "len"gth ?
Thanks
Bookmarks