Hey thanks... BTW i solved the problem with this loop:

Qt Code:
  1. qint64 size;
  2. QString serverPass;
  3. quint16 reqType;
  4. QByteArray data;
  5.  
  6. in >> size;
  7.  
  8. while (tcpSocket->bytesAvailable() < size) {
  9. if (!tcpSocket->waitForReadyRead()) {
  10. qDebug() << "Not enough bytes!";
  11. disconnectFromServer();
  12. return false;
  13. }
  14. }
  15.  
  16. in >> serverPass >> reqType >> data;
To copy to clipboard, switch view to plain text mode 

THANKS!!!