[ajug-members] checking for server availability

Paul McKibben pmckibben at gmail.com
Fri Apr 6 12:34:30 EDT 2007


Are you trying to verify (1) that a physical server machine is up and
running and reachable on the network, or (2) that a particular server
process is running and able to respond to messages?

For (1), you could try InetAddress.isReachable() -- I believe you need Java
5 or later.

For (2), your current approach is your best bet.  If you can, have the
server process respond to a simple "Are you there" message.  As long as you
aren't doing this for a large number of different servers or processes, and
assuming the heartbeat frequency is reasonable (e.g. no more frequent than 5
or 10 seconds), I wouldn't worry too much about message overhead.

HTH,
  Paul

On 4/6/07, Barnes, Mike <mike.barnes at cingular.com> wrote:
>
>  Is there a way to ping a host/port to see if it is available? I need to
> set up a heartbeat process and would like to do it as cheaply as possible
> (network time). The current way we are doing this is to send a known message
> to the server and wait for a response, I am not sure that this is the best
> way to check if a server is up or not.
>
>
>
> Thanks
>
> Mike Barnes
>
> _______________________________________________
> ajug-members mailing list
> ajug-members at ajug.org
> http://www.ajug.org/mailman/listinfo/ajug-members
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ajug.org/pipermail/ajug-members/attachments/20070406/d4a17d81/attachment.html 


More information about the ajug-members mailing list