[Lazarus] Detecting if a remote web server is running

Tony Whyman tony.whyman at mccallumwhyman.com
Thu Oct 30 13:11:12 CET 2014


Richard,

There is no substitute for "suck it and see". I have a web server that I
need to ensure keeps running. I monitor it from another system that runs
a CRON job every five minutes that uses "wget" to download the home
page. If this fails it EMails me.

As you are putting this on the lazarus list. I assume that you want to
do something similar from an interactive Pascal program. Here there is
no substitute for good error handling. My experience is with the indy
components and these will raise an exception if they can't download a
given webpage (timeout). You can catch this and give the user an
appropriate error message when they try to access a non-responding
server. You could even have a background thread to keep doing this, if
it is really important to tell the user as soon as possible.

Tony Whyman
MWA

On 30/10/14 09:44, Richard Mace wrote:
> Hi All,
> What's the most reliable way of detecting whether a remote website is
> responding?
>
> Thanks
>
> Richard
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141030/3772c5a4/attachment-0003.html>


More information about the Lazarus mailing list