Hello, could you please clarify. I have QTcpServer class who's send the data, and QTcpSocket class who's received this data.
I have a slot slotReadyRead() for ReadReady() signal like this:
void MyClient::slotReadyRead()
{
for (;;) {
if (!m_nNextBlockSize) {
if (m_pTcpSocket->bytesAvailable() < (int)sizeof(quint64)) {
break;
}
in >> m_nNextBlockSize;
}
if (m_pTcpSocket->bytesAvailable() < m_nNextBlockSize) {
break;
}
in >> bList; //QList
m_nNextBlockSize = 0;
}
}
void MyClient::slotReadyRead()
{
QDataStream in(m_pTcpSocket);
in.setVersion(QDataStream::Qt_4_8);
for (;;) {
if (!m_nNextBlockSize) {
if (m_pTcpSocket->bytesAvailable() < (int)sizeof(quint64)) {
break;
}
in >> m_nNextBlockSize;
}
if (m_pTcpSocket->bytesAvailable() < m_nNextBlockSize) {
break;
}
in >> bList; //QList
m_nNextBlockSize = 0;
}
}
To copy to clipboard, switch view to plain text mode
and I wondering how I can get the values of received date for update some progress indicator?
And second question, how it possible to increase the speed of transmitting data via QTcpSocket?
Thank you.
Bookmarks