troubleshooting Question

ASP Code to Get file causes server to lockup

Avatar of gregsschipper
gregsschipper asked on
Web Languages and StandardsScripting LanguagesMicrosoft Server Apps
22 Comments1 Solution558 ViewsLast Modified:
I use code below to GET and show links from a remote site.
Everything works well when the remote site is up.
If the remote site fails to respond, it nearly "locks up" the server running the code below.

I need a method to time out this get after 5 seconds.

Code is as follows:

REMOTE_FILE_URL="http://www.domain.com/page-links.htm"
Dim objXML, strContents, arrLines
Dim x
Set objXML=Server.CreateObject("Microsoft.XMLHTTP")
objXML.Open "GET", REMOTE_FILE_URL, False
objXML.Send
strContents=objXML.ResponseText
Set objXML=Nothing
xvar=unescape(strContents)
Response.Write xvar

Many Thanks in Advance, Greg
ASKER CERTIFIED SOLUTION
Robert Schutt
Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 22 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 22 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros