Hi,
I can't figure out why it doesn't send my data over the socket.
This is my code.

buffer is a class which contains a Qlist with myStructs in it.
This is because two threads are working with the buffer.
One adds the other gets.

Qt Code:
  1. void MyClass::WriteData{
  2. myStruct package;
  3.  
  4. while(!buffer->isEmptyMyStruct()){
  5. msleep(20);
  6. package = buffer->getMyStruct();
  7.  
  8. QByteArray block;
  9. QTextStream out(&block, QIODevice::ReadWrite);
  10.  
  11. out << package;
  12. out.flush();
  13.  
  14. tcpSocket->write(block);
  15. tcpSocket->flush();
  16.  
  17. emit message(package.message);
  18. emit message(package.id);
  19. }
  20. }
To copy to clipboard, switch view to plain text mode