PDA

View Full Version : Download via HTTP in several threads?



bjilly
28th November 2009, 07:27
Hello,

can please anybody point me out to samples or API how to download a file via HTTP in several threads? Standard QHttp seems does not provide with such functionality.


Thanks,

squidge
28th November 2009, 13:23
How about using both QHttp & QThread?

bjilly
28th November 2009, 14:26
How about using both QHttp & QThread?

yes, this way is accepted but currently I cannot figure out to make it. Sample source is very appreciated.

Thanks,

mgoetz
30th November 2009, 11:05
What is your goal? If it is downloading multiple files at once, you can just use multiple QHttp objects.

(BTW, for Qt 4.6 you should use QNetworkAccessManager, which will download on 6 connections)

bjilly
30th November 2009, 15:01
What is your goal? If it is downloading multiple files at once, you can just use multiple QHttp objects.

(BTW, for Qt 4.6 you should use QNetworkAccessManager, which will download on 6 connections)

I want to download one file by chunks in several threads. Unfortunately Qt 4.6 is not acceptable in the task -- 4.5 only.

mgoetz
30th November 2009, 15:07
Still, there is no need for threads if the limiting factor is the speed the server gives you.
Threads only make sense if the _local_ parsing of the HTTP is too slow and you use your multiple cores to accelerate.

bjilly
30th November 2009, 15:15
Still, there is no need for threads if the limiting factor is the speed the server gives you.
Threads only make sense if the _local_ parsing of the HTTP is too slow and you use your multiple cores to accelerate.

I understand this :) and speed here is not the limiting factor. So any ideas what is the best way to solve this task?