Hi all,
Peter: I am using a timer inside a web serive. This timer will keep
checking
5 websites whether they are running or not. I find that using
HttpWebRequest,
if I request a web site which is down, it takes more than 15 seconds to
return me the error. The only reason I cannot wait for this much amount
of
time is because I am using timer. I have 4 web sites and 1 ISAPI
application
that I need to keep checking whether they are running.
John: Your suggestions is good. I suppose this will be useful when I only
need to check whether the IIS is runnig or not. What will happen if the
IIS
is running fine and only one of the web sites is stopped. Is there any way
to
check easily whether that particular web site is working fine.
Thanks.
pradeep_tp
Peter Rilling said:
I think his problem was that he did not want to wait the few second for
the
timeout to happen.
I doubt you can ping the website and get an instant response, if that was
the case than all browsers would return a DNS immediately instead of
continually waiting for a response.
And yes, you cannot rely on ping either because ping checks to see if the
machine if running, not if IIS is running.
Is there a specific reason you feel you cannot wait until a timeout
happens?
"Saber" <saber[.AT.]oxin.ir> wrote in message
I'm not sure it is logical or not,
but if you use HttpWebRequest and you get no error when web site is
running,
so you can use a try catch block:
Dim isRunning As Boolean = True
Try
'your code
Catch ex As Exception
If ex.Message = "The error message you get" Then isRunning = False
End Try
Sorry if I misunderstood your problem.
hello all,
I want to know how can I check whether a web site us running or not. I
have
used HttpWebRequest but when I give a web site address, It takes few
number
of seconds to throw exception if the web site is not running. Is there
any
easy method of doing the same. I do *not* want to use IP to ping and
check
the server.
Thanks
pradeep_tp