Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QNetworkAccessManager number of requests limitation (interested in qt 4.8)

QNetworkAccessManager number of requests limitation (interested in qt 4.8)

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 7.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 2 Offline
    2 Offline
    2beers
    wrote on last edited by
    #1

    Hi everyone. I'm interested to know if there are some limitations in the number of requests in QNetworkAccessManager. Interested in the situation of qt 4.8.
    The reason why I'm asking this is because in this "post":http://labs.qt.nokia.com/2011/04/29/threaded-http-inside-qnetworkaccessmanager/ : on comment #4 Markus Goetz said something like this:

    The design philosophy is that you can pump in as many requests as you want and QNetworkAccessManager will limit its sockets to a internet friendly value (currently 6 per host:port on desktop machines, less on mobile).

    My application will require to make much more than 6 simultaneous requests , so I need to know if I understand correctly or is relating something else. If max requests is 6, how can I overwrite this?

    Thanks

    EDIT:
    I forgot to tell, I'm not using any webkit in my application.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      raulgd
      wrote on last edited by
      #2

      You actually have to handle your own requests queue and your own connection strategy. That means that for each thread, you will be able to handle at most 6 requests per connection, and even that, because it's designed for a thread per connection strategy, it's not even worth it to have send 6 simultaneous requests per access manager.
      So it doesn't limit your app to 6 simultaneous requests, it just limits it to 6 simultaneous requests per access manager, so if you need, let's say, 18 requests, you just create 3 threads with a QNetworkAccessManager object in each thread, and send 6 requests in each, but I wouldn't recommend that unless you really know how QNetworkAccessManager behaves, if you don't just use a thread per request and you are limited by your computer's ability to handle threads, or if you want to optimize, create a thread pool, where you queue requests, and as soon as one thread is done with a request, instead of destroying it, assign it another request from the queue (if you have database experience, it's like a database connection pool but for HTTP requests).

      Raul Guerrero
      http://jimi.mx

      1 Reply Last reply
      0
      • 2 Offline
        2 Offline
        2beers
        wrote on last edited by
        #3

        oh. thanks raul. It won't be more than 1 simultaneous request for every QNetworkAccessManager object.
        I thought that is was limited to 6 simultaneous requests/application .

        Thanks

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved