Results 1 to 5 of 5

Thread: QNetworkAccessManager: only 6 requests are executed in parallel for one host

  1. #1
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    2
    Thanked 6 Times in 6 Posts

    Question QNetworkAccessManager: only 6 requests are executed in parallel for one host

    QNetworkAccessManager:

    Note: QNetworkAccessManager queues the requests it receives. The number of requests executed in parallel is dependent on the protocol. Currently, for the HTTP protocol on desktop platforms, 6 requests are executed in parallel for one host/port combination.
    is there any way to increase that number?
    I want to create a Download Manager app... and , because of multipart download, I need more requests in parallel for one host.

    is a good idea to have a pool of QNetworkAccessManager objects in my app and balance the requests among them?
    QT Documentation says this:
    One QNetworkAccessManager should be enough for the whole Qt application.
    can I modify Qt source code to increase that number? where?? what are the drawbacks of doing that?
    in qhttpnetworkconnection.cpp is this:
    Qt Code:
    1. #ifdef Q_OS_SYMBIAN
    2. const int QHttpNetworkConnectionPrivate::defaultChannelCount = 3;
    3. #else
    4. const int QHttpNetworkConnectionPrivate::defaultChannelCount = 6;
    5. #endif
    6.  
    7. // The pipeline length. So there will be 4 requests in flight.
    8. const int QHttpNetworkConnectionPrivate::defaultPipelineLength = 3;
    9. // Only re-fill the pipeline if there's defaultRePipelineLength slots free in the pipeline.
    10. // This means that there are 2 requests in flight and 2 slots free that will be re-filled.
    11. const int QHttpNetworkConnectionPrivate::defaultRePipelineLength = 2;
    To copy to clipboard, switch view to plain text mode 


    any other idea?

    thank you

  2. #2
    Join Date
    Jan 2010
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QNetworkAccessManager: only 6 requests are executed in parallel for one host

    You can use multiple qnetworkaccessmanagers.

    I have a quite large application that during 'peak' needs quite a few concurrent connections in various threads, so i put a qnam in each thread(each thread manages up to 6 connections). It works.

    If you are connecting to different hosts/ports this limitation does not apply btw. Its per hostort .

  3. #3
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    2
    Thanked 6 Times in 6 Posts

    Default Re: QNetworkAccessManager: only 6 requests are executed in parallel for one host

    Thanks...

    but...
    why do you need threads?? qnam is already asyncronous...

  4. #4
    Join Date
    Jan 2010
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QNetworkAccessManager: only 6 requests are executed in parallel for one host

    I need threads for different reasons(various cpu or io intensive tasks), but it works out well since it makes it possible to use quite a few extra concurrent connections.

  5. #5
    Join Date
    Jul 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QNetworkAccessManager: only 6 requests are executed in parallel for one host

    Tried HTTP-pipelining? Using pipelining QNetworkAccessManager does put multiple requests in a single packet.

    Qt Code:
    1. request.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
    To copy to clipboard, switch view to plain text mode 
    Beware of bugs in the above code; I have only proved it correct, not tried it. (Donald Knuth)

Similar Threads

  1. Replies: 5
    Last Post: 23rd October 2010, 00:52
  2. Replies: 1
    Last Post: 17th July 2010, 12:02
  3. QThread slot executed in GUI thread
    By tnyblom in forum Qt Programming
    Replies: 13
    Last Post: 25th May 2010, 07:49
  4. Replies: 12
    Last Post: 25th December 2009, 15:07
  5. Qt::WA_DeleteOnClose while a child QDialog is executed
    By nooky59 in forum Qt Programming
    Replies: 4
    Last Post: 11th July 2008, 12:45

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.