August 5, 2011

2beers 2beers
Lab Rat
111 posts

QNetworkAccessManager number of requests limitation (interested in qt 4.8)

 

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 [labs.qt.nokia.com] : 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.

2 replies

August 6, 2011

Raul Raul
Lab Rat
96 posts

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).

 Signature 

Raul Guerrero
http://jimi.mx

August 6, 2011

2beers 2beers
Lab Rat
111 posts

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

 
  ‹‹ [SOLVED]Want to expand QTextEdit ..      Creating wait screen ››

You must log in to post a reply. Not a member yet? Register here!