Microsoft
Software
Hardware
Network
Question : WScript: Retry on HTTP GET Connection Timeout
Hi there,
The following command line runs the following WScript for monitoring a website.
All is working fine. I need to add a function to the wscript so that when it can't connect for 1 second, it retries to connect 5 times (with the same 1sec timeout.) If after the last try it still can't connect, it will output the following message "ConnectionTimeout" then exit.
Can you help me with this?
COMMAND LINE: cscript Monitor.js
http://en.wikipedia.org/wi
ki/Baloghi
a
>Output.t
xt
WScript (NAME: Monitor.js):
var request = new ActiveXObject("Msxml2.XMLH
TTP");
var notyetready = 1;
request.onreadystatechange
=function(
)
{
if(request.readyState==4)
{
WScript.Echo(request.respo
nseText);
notyetready = 0;
}
}
var objArgs = WScript.Arguments;
WScript.Echo(objArgs(0));
request.open( "GET", objArgs(0) , true );
request.send(null);
while( notyetready )
{
WScript.Sleep( 100 );
}
Thanks for your help,
Rene
Answer : WScript: Retry on HTTP GET Connection Timeout
no problema mate :)
Random Solutions
IIS 7 - setting up the site with www.
Saving Favorites in Windows 7, IE 8
Windows 2008 Standard server connects at 1GB/S but reverts back to 10MB/S
Sync Access database contacts with Exchange Contacts list
OWA - The certificate is not valid for the requested usage
WCF hosted on IIS: Why doesn't it show me the WCF method name and it's signature?
Having issues converting Physical ISA server to Virtual Server
WHAT'S THE DIFFERENCE BETWEEN NATURAL KEYS AND surrogate keys
OWA will not work for mailbox in non-internet facing AD site
NAT on ASA to a remote server