You could use the CFHTTP tag along with the TIMEOUT and THROWONERROR
attributes.  Something like this:

        <CFSET TIMEOUT_PERIOD = "">     <!--- # seconds to wait on a response --->
        <CFSET URLS_TO_TRY_LIST = "">   <!--- List of URLs to attempt to contact --->
        <CFSET URL_AVAILABLE = FALSE> <!--- Flag for availability of the URL --->
        <CFLOOP INDEX="URL_TO_TRY" LIST="#URLS_TO_TRY_LIST#>
                <CFTRY>
                        <CFHTTP
                                URL="#URL_TO_TRY#"
                                METHOD="GET"
                                TIMEOUT="#TIMEOUT_PERIOD#"
                                THROWONERROR="yes">
                        <CFSET URL_AVAILABLE = TRUE>
                        <CFBREAK>
                <CFCATCH>
                        <!--- CHECK WHATEVER CFHTTP.* VALUES NEEDED AND CONTINUE (OR 
NOT) --->
                </CFCATCH>
                </CFTRY>
        </CFLOOP>

        <CFIF URL_AVAILABLE><!--- DO WHATEVER --->

Caveats: If you have to do multiple transactions, there's no guarantee that
a given URL won't become unavailable in between the time that you check and
the time you actually try to do something else.  Also, processing on the
other web server after the timeout won't necessarily cease when ColdFusion
on your end does, so you have to be careful about things like database
changes (updates/inserts/deletes).

Hope this helps...

Regards,
Joel Parramore

> -----Original Message-----
> From: Roberts, William C [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 12, 2001 3:10 PM
> To: CF-Server
> Subject: Need help pronto - Unresponsive server determination...
>
>
> I understand that there's an undocumented function called
> "CFusion_VerifyMail" that verifies whether the Mail server was up
> or not. If
> it was up the tag resends the unsent mail to the Mail Server, etc....
>
> Used like:
> <cfset Verify = CFusion_VerifyMail('mail.myserver.com',25,60)>
> <cfif Verify IS NOT "">
> <cfoutput>#Verify#</cfoutput>
> <cfelse>
> Connection Verified !<br>
>
>
> My Question:
> I need to know if I can use a similar function to determine if a fully
> qualified URL (with a CF extension) doesn't respond within "x" number of
> seconds, to try another server. Does anyone know how to do that?
>
> Please help if you can!!!
> Thanks, Bill
>
> __________________________________
> Space Beach Engineering
> The Boeing Company
> Macromedia Certified ColdFusion 5 Developer
> Microsoft Certified Professional
> Web: http://hbweb.web.boeing.com/eng/ <http://hbweb.web.boeing.com/eng/>
> Email: [EMAIL PROTECTED] -- (714) 934-0653
>
>
>
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with 
'unsubscribe' in the body or visit the list page at www.houseoffusion.com

Reply via email to