Quote Originally Posted by squidge View Post
It could be 1 byte.

If your array will be less than 255 characters then send 1 byte for the length.
If your array will be less than 65535 characters then send 2 bytes for the length and ensure you have 2 bytes before assuming you have the length.
etc.
Thanks.
I think it will be better to send always 32-bit interger (qint32) and check bytesAvailable >= 4.