I try it like this:
void Interface::readyReadSlot()
{
qDebug() << "readyReadSlot()";
while (!tcpsocket->atEnd()) {
byteblock += data;
}
stream >> string;
qDebug() << "received:" << in_string;
}
void Interface::readyReadSlot()
{
qDebug() << "readyReadSlot()";
QByteArray byteblock;
while (!tcpsocket->atEnd()) {
QByteArray data = tcpsocket->read(100);
byteblock += data;
}
QDataStream stream(&byteblock, QIODevice::ReadOnly);
QString string;
stream >> string;
qDebug() << "received:" << in_string;
}
To copy to clipboard, switch view to plain text mode
if the server sends a too long bytearray the Debug-Output is received " ", otherwise it's correct.
What's wrong?
Bookmarks