QIODevice::readyRead is edge-triggered, not level-triggered. Thus it
can't be relied on to be triggered again if only part of the available
data is read.
void XinemaControl::data_available()
{
- char rbuf[1024];
- int len = socket.read(rbuf, sizeof(rbuf));
- if(len<0)
- return;
+ while(socket.bytesAvailable())
+ {
+ char rbuf[1024];
+ int len = socket.read(rbuf, sizeof(rbuf));
+ if(len<0)
+ break;
+
+ buffer.append(rbuf, len);
+ }
- buffer.append(rbuf, len);
unsigned start = 0;
while(1)
{