Topaz Filer - Email filing software
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

Reply to this message...
Vote that this is a GOOD answer...
 
New BootFX DBGet build available
Twitter and Snow… simple #uksnow
 
    
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

Reply to this message...
Vote that this is a GOOD answer...
 
Windows 7 compatible tool for mounting ISO images
Introduction to BootFX’s Object Relational Mapping Functionality article now live on CodeProject
 
    
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]

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
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]

Reply to this message...
Vote that this is a GOOD answer...
 
Xenu Link Sleuth
Chromium OS – really?
 
    
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]

Reply to this message...
Vote that this is a GOOD answer...
 
Invocation Software – the new name for the makers of Topaz Filer
Agile Modeling
 
    
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]

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
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]

Reply to this message...
Vote that this is a GOOD answer...
 
Creating colourways for Web development
URL shortening as a service
 
    
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]

Reply to this message...
Vote that this is a GOOD answer...
 
New BootFX DBGet build available
Twitter and Snow… simple #uksnow
 
 
System.Net.HttpWebRequest
System.Net.WebRequest
System.Net.WebResponse




Ad
BootFX
Reliable and powerful .NET application framework.
Looking to invest in a major software project? Technical and commercial advice available here.
Other Helpful Sites
MBR 247
Topaz Filer
SharePoint Email Filing
Software Advisory Services
 
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734