473,395 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

problem in webresponse

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 "HttpWebResponse response = (HttpWebResponse) 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.Text);
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(tval);
req.AddRange(file_size_ar[i], file_size_ar[i + 1] - 1);
HttpWebResponse response = (HttpWebResponse) req.GetResponse(); ***
Stream str_eam = response.GetResponseStream();


PLease help me
Nov 27 '06 #1
0 897

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Craig | last post by:
I wrote a generic page to do HttpWebRequest operations based on 3 querystring parameters for the uri, username, and password for basic authentication pages. The page is designed to help with...
4
by: octavio.filipe | last post by:
Hi, I'm trying to use the following code: HttpWebRequest webRequest = WebRequest.Create(LOGIN_URL) as HttpWebRequest; webRequest.CookieContainer = new CookieContainer(); HttpWebResponse...
2
by: Jeff G. | last post by:
Hello everyone, I have read through the newsgroups (thank God for 'em!) extensively looking for an example of how to pass a file (PDF) from a webresponse stream down to a web client. Here's the...
4
by: Savas Ates | last post by:
I have a vb.net web application. I want to post some variables to another web page and take some values back and process them. This is codes in my target url. I should post "langpair" cariable...
0
by: Alok yadav | last post by:
i am using the link of metacharge.com for payment gateway, when i post data throung IE it give the correct response, but when i use the .net code to post data the response is not correct.message is...
0
by: RiskyHunter | last post by:
Hi; am using httpUnit in order 2 extract the source code of the websit but the problem is that the httpUnit respond is very slow, this is my code public String extractNewFile() throws...
3
by: KyleUbenk | last post by:
Well I have a multi-threaded program which downloads URL sources from the web. Im doing this multiple times at once. The only problem I see is that sometimes it takes a while to download the...
4
by: CindyH | last post by:
Hi - hope someone can help with this - this code was working for a while in the 'real' code and then suddenly stopped - not sure what happen. I made two simple forms on localhost to try to test...
1
by: Proogeren | last post by:
I have a problem with a httpwebrequest that I am creating. The request in itself looks correct but using fiddler I see that a www-authentication header is sent along as well. The code is pasted...
1
Kevinyy
by: Kevinyy | last post by:
When i pass certain request through: WebResponse response = (WebResponse)WebRequest.Create(url).GetResponse(); Stream responsestream = response.GetResponseStream(); I sometimes get this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.