I really didn’t know on what forum I could post my question. Sorry If I’m the wrong forum. Anyway, I have a simple HTTPWebRequest and I set its Timeout property to 10 seconds like this:
The thing is that even though I set the timeout to 10 seconds, for an invalid request (server not responding, too busy or unavailable) it still takes around 20 seconds to return an exception. I’ve been testing this scenario and definitely it takes way more
than my timeout value of 10 seconds to return an exception.
I would like to return the exception right after 10 seconds (set in timeout attribute) instead of 20. Is there a way to accomplish this? Any info is greatly appreciated. Thanks!
rpeiro
Member
7 Points
14 Posts
Question about HttpWebRequest (Timeout property)
Sep 16, 2011 05:14 PM|LINK
I really didn’t know on what forum I could post my question. Sorry If I’m the wrong forum. Anyway, I have a simple HTTPWebRequest and I set its Timeout property to 10 seconds like this:
The thing is that even though I set the timeout to 10 seconds, for an invalid request (server not responding, too busy or unavailable) it still takes around 20 seconds to return an exception. I’ve been testing this scenario and definitely it takes way more than my timeout value of 10 seconds to return an exception.
I would like to return the exception right after 10 seconds (set in timeout attribute) instead of 20. Is there a way to accomplish this? Any info is greatly appreciated. Thanks!