ASP 101 - Active Server Pages 101 - Web04
The Place ASP Developers Go!

Please visit our partners

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates

ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash

FAQ for the Http Request sample:

Sometimes the sample takes a long time to return. Is there a way to reduce the waiting time?

Delays are usually caused by network congestion or the remote server being temporarily unavailable. You can set the time for the component to wait for a reply by using the SetTimeouts method:

objWinHttp.SetTimeouts 5000, 10000, 10000, 10000

You'll notice it takes 4 parameters: ResolveTimeout, ConnectTimeout, SendTimeout, and ReceiveTimeout. All 4 are required and are expressed in milliseconds (1000 = 1 second). The defaults are:

ResolveTimeout: zero (no time out)
ConnectTimeout: 60,000 (one minute)
SendTimeout: 30,000 (30 secs.)
ReceiveTimeout: 30,000 (30 secs.)

It should be noted that the Send and Receive timeouts are per packet, so for larger responses (which are split into multiple packets) the timeouts are checked for each packet.

If any of the timeouts is reached, an "operation timed out" error is thrown and should be handled.

Okay... so I'm supposed to handle those operation timed out errors. How?

Funny you should ask... we happen to have a sample script that shows you just how to do that.

HTTP Request Timeout Sample

So you're using ASP.NET... no problem. Here's a ASP.NET version that illustrates how to set timeouts and handle the error that is thrown when the remote server doesn't respond quickly enough.

Handling HTTP Request Timeouts in ASP.NET

It's not much to look at, but you can also view the source code which should be a little more helpful.

Was your question not answered above?

Ask a new question

Please note: This form is only for submitting questions about the sample for us to consider including in the FAQ. If we feel the question merits inclusion, we will include it along with a reply. We will not respond to your email individually.

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers