I create a downloder program.When I want to download a file , I divide file to 4 parts then program downlads file with 4 threads . ( every thread downloads one part of file) But when 2 threads start ,third and fourth threads dosent continue and they stay in "HttpWebRespons e response = (HttpWebRespons e) req.GetResponse ();" statement until one thread finishes its part . after that third thread continues. I mean only 2 threads run together at ones time. and it happens in response statement. What do you do every 4 threads run together ?
My code:
Uri tval = new Uri(textBox1.Te xt);
HttpWebRequest req = (HttpWebRequest )WebRequest.Cre ate(tval);
req.AddRange(fi le_size_ar[i], file_size_ar[i + 1] - 1);
HttpWebResponse response = (HttpWebRespons e) req.GetResponse (); ***
Stream str_eam = response.GetRes ponseStream();
PLease help me
My code:
Uri tval = new Uri(textBox1.Te xt);
HttpWebRequest req = (HttpWebRequest )WebRequest.Cre ate(tval);
req.AddRange(fi le_size_ar[i], file_size_ar[i + 1] - 1);
HttpWebResponse response = (HttpWebRespons e) req.GetResponse (); ***
Stream str_eam = response.GetRes ponseStream();
PLease help me