Ok, according to the example you gave, your length seems to have a 2 octet size, if the size is fixed try this
client.read(lenBA.data(), 2); // read the first integer for the length
short int length = lenBA.toShort(); // check the conversion is ok here
data.reserve(length);
client.read(data.data(), length );
QByteArray lenBA(2,'0');
QByteArray data;
client.read(lenBA.data(), 2); // read the first integer for the length
short int length = lenBA.toShort(); // check the conversion is ok here
data.reserve(length);
client.read(data.data(), length );
To copy to clipboard, switch view to plain text mode
1632843572 = 0x61533734 and give in ascii : "aS74" look realy close to "47Sa" if you considering byte order issue from brutal conversion from char * to int.
Bookmarks