I am sending a QByteArray from server to client. the client needs to extract the first four bytes for length of packet and then read the rest of the packet. The unexpected value I get from length of packet though, is a very large value;
what I do is:
int len;
char *data;
client.read((char*)len, 4); // read the first integer for the length
client.read(data, len);
int len;
char *data;
client.read((char*)len, 4); // read the first integer for the length
client.read(data, len);
To copy to clipboard, switch view to plain text mode
can anyone guess what the problem is?
Bookmarks