HttpWebRequest Timeout
-
I've been doing some testing with the HttpWebRequest object returned from WebRequest.Create(sURL) method and found that the timeout property is not very precise. It often times out after more than twice the value I set. For example it takes about 30 seconds for a timeout value of 15000. I’ve seen it take 15 seconds for a value of 5000. Plus or minus a few seconds I could let slip but what might be the reason for more than doubling the timeout value? (I tested the timeout by turning the power off to my cable modem. My computer is connected to the modem through a router which I left on.)
-
I've been doing some testing with the HttpWebRequest object returned from WebRequest.Create(sURL) method and found that the timeout property is not very precise. It often times out after more than twice the value I set. For example it takes about 30 seconds for a timeout value of 15000. I’ve seen it take 15 seconds for a value of 5000. Plus or minus a few seconds I could let slip but what might be the reason for more than doubling the timeout value? (I tested the timeout by turning the power off to my cable modem. My computer is connected to the modem through a router which I left on.)
Is this happening in a separate thread? How many threads might there be running simultaneously?
-
Is this happening in a separate thread? How many threads might there be running simultaneously?
-
I've been doing all my tests in a new "test" solution right in the constructor of Form1. So its only one thread. hmmm.... I wonder if its the debugger that is causing this. I will have to test it in a Release version.
Certainly try it outside of the debugger ("Start Without Debugging"). A Release build shouldn't be necessary, but it would be interesting if it did...