I've been working with QTCPSocket and it only ever receives data up to 1024 bytes, but the data coming to me can be up to 1536 bytes.

I've tried to increase the receive socket buffer using socket->setReadBufferSize(1536) but it still only receives 1024 at most:
Bytes to read: 1024
Bytes to read: 21

When I set setReadBufferSize to 512 I do get
Bytes to read: 512
Bytes to read: 512
Bytes to read: 21

But I cannot set it higher than 1024. I've even tried to make use of setsockopt
Qt Code:
  1. int iSize = 2048;
  2. fd = socket->socketDescriptor();
  3. setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &iSize, sizeof(iSize));
To copy to clipboard, switch view to plain text mode 

And nothing changes.

The data I get does vary (a few bytes to what seems to be never more than 2048 bytes) and is essentially telnet data (MUD text game). Though, after 1024 the data is broken up a bit and my output to the screen is a bit broken up.

My readRead() looks like
Qt Code:
  1. ::readyRead() {
  2. while(socket->bytesAvailable())
  3. {
  4. QByteArray data = socket->readAll();
  5. emit processData(data);
  6. }
  7. }
To copy to clipboard, switch view to plain text mode 

Any suggestions I could look at?