i have made a server-client program. when i tries to send QString variable, i didn't faced any problem. but when i modified it so as to send quint32 variable, its not working. actually nothing is being received at the other end. please help, below is my modified code
QByteArray arr;
//QString msg = msglineEdit->text();
QDataStream out(&arr, QIODevice::WriteOnly);
out.setVersion(QDataStream::Qt_4_1);
out << (qint16)sizeof(calc_mac); //calc_mac is quint32
out << calc_mac;
qDebug() << "created bytearray size:" << arr.size();
qDebug() << "msg size:" << (qint16)sizeof(calc_mac) << "(" << calc_mac << ")";
tcpSocket->write(arr);
while(tcpSocket->bytesToWrite() > 0)
{
tcpSocket->waitForBytesWritten();
}
qDebug() << "bytes written";
Bookmarks