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.
void MyClass::WriteData{
myStruct package;
while(!buffer->isEmptyMyStruct()){
msleep(20);
package = buffer->getMyStruct();
out << package;
out.flush();
tcpSocket->write(block);
tcpSocket->flush();
emit message(package.message);
emit message(package.id);
}
}
void MyClass::WriteData{
myStruct package;
while(!buffer->isEmptyMyStruct()){
msleep(20);
package = buffer->getMyStruct();
QByteArray block;
QTextStream out(&block, QIODevice::ReadWrite);
out << package;
out.flush();
tcpSocket->write(block);
tcpSocket->flush();
emit message(package.message);
emit message(package.id);
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks