For example flashget.It can download different parts simultaneously.I wonder this.How can it achieve this If there is no avaliable api.General algorithm will enough for me..
Console.WriteLine ("Content length is {0}", response.ContentLength); but how can i take different parts simultaneously from server I can not find solution from your link.
Using System.Net.HttpWebRequest you can request multiple objects from an HTTP server at once; however, the number you can simultaneously request is limited by the number of connections you can open to a given server. The RFC recommends no more than 2 connections per host to a given server. Therefore, you can request 2 objects at once from a server. You can adjust the number of connections to a given server that System.Net will create using the ServicePointManager class or an application configuration file.
Also, to increase performance, you can enable pipelining (via a property on the HttpWebRequest class). This allows you to send multiple requests over a connection before hearing the response of the first request.
Thanks for all answers.I think ergin and JonCole(AddRange) answers are what i am looking for.Also @Mike Flasko now i don't know what ServicePointManager class is.But i will search it. Also more advices for download accelarator progrraming will help me more(If anyone want to share some ideas or advices). Thanks.
Download accelarators
mossay
LegacyOfHerot
Using System.Net.HttpWebRequest you can request multiple objects from an HTTP server at once; however, the number you can simultaneously request is limited by the number of connections you can open to a given server. The RFC recommends no more than 2 connections per host to a given server. Therefore, you can request 2 objects at once from a server. You can adjust the number of connections to a given server that System.Net will create using the ServicePointManager class or an application configuration file.
Also, to increase performance, you can enable pipelining (via a property on the HttpWebRequest class). This allows you to send multiple requests over a connection before hearing the response of the first request.
I hope this helps..
Jeffrey Schlimmer
Arjan Mels
Thanks for all answers.I think ergin and JonCole(AddRange) answers are what i am looking for.Also
@Mike Flasko now i don't know what ServicePointManager class is.But i will search it.
Also more advices for download accelarator progrraming will help me more(If anyone want to share some ideas or advices).
Thanks.
ErickLopez
I think section 14.35 describes how to do it. Section 14.13 mentions how to get the length without getting the data.
AngryTree
Add an extra header into your request; Range: bytes=startFromByte-ByteLength
Range: bytes=500-999
Get 500 bytes, start from 500th byte and receive 500 bytes (999 -500+1) = 500
check the link above for more information.