|
| BUG FOUND IN FRAMEWORK: HttpWebRequest Class |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.framework.
| Sam Hulick |
(Remove the XYZ from my email address to email me)
Hopefully I'm not just doing something stupid.. if I am, I apologize. I'm trying to fetch pages using HttpWebRequest. Most pages work fine. Some lock up. Here's the code:
HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(txtURL.Text); wr.AllowAutoRedirect = true; wr.MaximumAutomaticRedirections = 50; wr.Timeout = 5000; wr = (HttpWebRequest)WebRequest.Create(txtURL.Text); WebResponse resp = wr.GetResponse(); Stream webstream = resp.GetResponseStream();
Anyway, it locks up on the wr.GetResponse(). These sites work fine:
http://www.msn.com/ http://www.amazon.com/
These sites lock up the app:
http://www.ameritech.net/ http://www.msnbc.com/
The other odd thing is, the Timeout of 5000 ms is totally ignored.
So is this a bug in the Framework? Anyone know why this happens?
Thanks,
Sam
|
|
|
| |
|
| |
| |
| Enriko Riba |
Hi Sam,
You are overwritting your wr object!
"Sam Hulick" <Click here to reveal e-mail address> wrote in message news:OqtnZumBCHA.2672@tkmsftngp05... [Original message clipped]
> wr = (HttpWebRequest)WebRequest.Create(txtURL.Text); !!!! this creates the second new wr object
[Original message clipped]
best regards Enriko
|
|
|
| |
|
| |
| |
| Sam Hulick |
Thanks
Now the timeout works. But those sites still cause the app to lock up. Any idea why??
"Enriko Riba" <Click here to reveal e-mail address> wrote in message news:ORaf4duBCHA.1696@tkmsftngp04... [Original message clipped]
|
|
|
| |
|
|
| |
| |
| Tom Kaiser |
So what do you mean it locks up?
does the wr.GetResponse() execute? Where is it locking up?
Are you doing this from inside a corporate firewall where you are going through a proxy?
"Sam Hulick" <Click here to reveal e-mail address> wrote in message news:eP1fRjuBCHA.1664@tkmsftngp02... [Original message clipped]
|
|
|
| |
|
| |
| |
| Sam Hulick |
wr.GetResponse() executes but it stays there until it reaches the timeout value I specified. Then the timeout exception is thrown.
No, no fancy proxies or anything.. just a NAT firewall, nothing else special. I can surf to these sites normally.
"Tom Kaiser" <Click here to reveal e-mail address> wrote in message news:#iWXOR4BCHA.2464@tkmsftngp05... [Original message clipped]
|
|
|
| |
|
| |
| |
| Tom Kaiser |
Can you provide a trace of a request to a page that locks up?
or send me the url of one of these pages.
Thanks Tom
"Sam Hulick" <Click here to reveal e-mail address> wrote in message news:O$pQ3oFCCHA.580@tkmsftngp02... [Original message clipped]
|
|
|
| |
|
|
| |
| |
| michael |
Hi,
By any chance is there a process running on your machine that is eating up 100% of the cpu? I just spent a week debugging a problem with .NET web clients hanging. They would hang on GetResponse whenever there was a process on the machine eating 100% of the cpu (seti, distributed.net, while(true){} loop in a C++ command line program). As soon as I stopped that process, the clients worked fine.I have no idea how this other process could be affecting the .NET web service client.
Michael
"Tom Kaiser" <Click here to reveal e-mail address> wrote in message news:eZ5ZqsQCCHA.1272@tkmsftngp04... [Original message clipped]
|
|
|
| |
|
| |
| |
| Sam Hulick |
Wow.. you know what, I do run that Cancer Research app. It eats 100% CPU, but only idle cycles. I'll try disabling that & seeing what happens.
Thanks for the tip!
"michael" <Click here to reveal e-mail address> wrote in message news:#OMPfYxCCHA.2540@tkmsftngp05... [Original message clipped]
|
|
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|