Timeout property

G

Guest

Dear All

I am writing an application which fetches Web pages. I have been using the System.Net.HttpWebRequest.Timeout property to specify how long a request made with the GetResponse() method should wait for an answer. Nevertheless, my impression is that it does not work. No matter which value I set for the Timeout property, my requests may hang indefinitely when fetching certain Web pages

I have noticed that there is a new property called HttpWebRequest.ReadWriteTimeout. Would this new property be more appropriate to use in my case

Thank you
Marco
 
G

Guest

Microsoft's documentation don't say much about this new property which is to be available from version 1.1 onwards, however Timeout property should be working properly unless you are using asynchronous I/O methods to access web pages or ignoring WebException
hope it should help you to figure out what's going on

Abh

----- Marco wrote: ----

Dear All

I am writing an application which fetches Web pages. I have been using the System.Net.HttpWebRequest.Timeout property to specify how long a request made with the GetResponse() method should wait for an answer. Nevertheless, my impression is that it does not work. No matter which value I set for the Timeout property, my requests may hang indefinitely when fetching certain Web pages

I have noticed that there is a new property called HttpWebRequest.ReadWriteTimeout. Would this new property be more appropriate to use in my case

Thank you
Marco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top