Hey thanks... BTW i solved the problem with this loop:
qint64 size;
quint16 reqType;
in >> size;
while (tcpSocket->bytesAvailable() < size) {
if (!tcpSocket->waitForReadyRead()) {
qDebug() << "Not enough bytes!";
disconnectFromServer();
return false;
}
}
in >> serverPass >> reqType >> data;
qint64 size;
QString serverPass;
quint16 reqType;
QByteArray data;
in >> size;
while (tcpSocket->bytesAvailable() < size) {
if (!tcpSocket->waitForReadyRead()) {
qDebug() << "Not enough bytes!";
disconnectFromServer();
return false;
}
}
in >> serverPass >> reqType >> data;
To copy to clipboard, switch view to plain text mode
THANKS!!! 
Bookmarks