I am working on a multithread download manager. I want to divide the file into ranges to download with different threads. When a range download is completed I need to divide one of the remaining ranges into two ranges to keep the number of threads constant. So how to change a webrequests range after it started to download to make it stop on the end of the range? I have the code block below but it didn't work.
var webReq = WebRequest.Create(url) as HttpWebRequest;
webReq.AddRange(start, end);
var webResp = webReq.GetResponse() as HttpWebResponse;
webReq.AddRange(start, end2);