View Full Version : QNetworkReply - how to set bandwidth limit properly ?

19th August 2015, 17:35
Hi, I'm trying to set speed limit in my application using QNetworkReply but my code doesn't work properly.

QNetworkReply* reply;
if(postData.isEmpty()) {
reply = m_manager->get(*this->generateRequest(url));
} else {
reply = m_manager->post(*this->generateRequest(url),postData);
if(Values().DOWNLOAD_SPEED_LIMIT && (this->m_name != "Updater")){
reply->setReadBufferSize(Values().DOWNLOAD_SPEED_LIMIT_VA LUE);

I don't know why but for some reasons setReadBufferSize doesn't work, I need really simple solution...

Thanks for any help

19th August 2015, 18:24
What does the read buffer size have to do with a speed limit?

The read buffer size is, as indicated by its name, the size of the buffer used for incoming data.
The amount of data read from the operating system's buffer into the application's memory.