Hi,
I develeoped Client Server Communication with QSslSocket, The protocol of the communication is xml.
The xml strings can be very long and so I want to use compression.
I did it and it seems to work, but I get following message at the client:
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
qUncompress: Z_DATA_ERROR: Input data is corrupted
To copy to clipboard, switch view to plain text mode
Server:
void Server
::sendXML(QString message
) { block.append(message);
socket->write(qCompress(block));
}
void Server::sendXML(QString message) {
QByteArray block;
block.append(message);
socket->write(qCompress(block));
}
To copy to clipboard, switch view to plain text mode
Client:
void Client::readyReadSlot()
{
buffer.append(socket->readAll());
QString result
(qUncompress
(buffer
));
}
void Client::readyReadSlot()
{
buffer.append(socket->readAll());
QString result(qUncompress(buffer));
}
To copy to clipboard, switch view to plain text mode
It works, but what can I do against the error message.
thank u
Bookmarks