Results 1 to 2 of 2

Thread: QNetworkReply - how to set bandwidth limit properly ?

  1. #1
    Join Date
    Aug 2015
    Location
    Poland/UK
    Posts
    30
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QNetworkReply - how to set bandwidth limit properly ?

    Hi, I'm trying to set speed limit in my application using QNetworkReply but my code doesn't work properly.

    Qt Code:
    1. QNetworkReply* reply;
    2. if(postData.isEmpty()) {
    3. reply = m_manager->get(*this->generateRequest(url));
    4. } else {
    5. reply = m_manager->post(*this->generateRequest(url),postData);
    6. }
    7. if(Values().DOWNLOAD_SPEED_LIMIT && (this->m_name != "Updater")){
    8. reply->setReadBufferSize(Values().DOWNLOAD_SPEED_LIMIT_VALUE);
    9. }
    To copy to clipboard, switch view to plain text mode 

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

    Thanks for any help
    Cheers

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkReply - how to set bandwidth limit properly ?

    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.

    Cheers,
    _

Similar Threads

  1. bandwidth
    By Ali Reza in forum General Programming
    Replies: 6
    Last Post: 14th November 2012, 16:11
  2. Moniter the internet bandwidth
    By gaurp in forum Newbie
    Replies: 1
    Last Post: 5th June 2012, 15:56
  3. Replies: 1
    Last Post: 22nd July 2011, 13:22
  4. Distribute bandwidth with QTcpSocket
    By danc81 in forum Qt Programming
    Replies: 2
    Last Post: 19th October 2009, 13:17
  5. QNetworkAccessManager bandwidth throttling
    By bluefly in forum Qt Programming
    Replies: 6
    Last Post: 14th April 2009, 20:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.