Sharkysoft home

lava.io
Class Ping

java.lang.Object
  |
  +--lava.io.Ping

public class Ping
extends java.lang.Object

ICMP-based ping utilities.

Details: Ping is a collection of functions for performing low level, ICMP-based ping tests on remote hosts.

Presently, Ping contains only one function, countReplies. More will be added later. If you have requests, please submit them to Sharkysoft.

Warning: Ping uses a few platform-dependent tricks. You should verify that this class works on your target platform before integrating it into your application. Run the stand-alone test by executing this class from the command line:

java lava.io.Ping <host> [<count>]

Ping has been tested and found operational on the following platforms:

If you test Ping and find that it works on another platform, please let Sharkysoft know so we can add the platform to the above list.

Since:
2000.10.21
Author:
Sharky

Constructor Summary
Ping()
           
 
Method Summary
static int countReplies(java.lang.String host, int tries)
          Counts replies from pinged host.
static void main(java.lang.String[] args)
          Test program entry point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ping

public Ping()
Method Detail

countReplies

public static int countReplies(java.lang.String host,
                               int tries)
                        throws java.io.IOException
Counts replies from pinged host.

Details: countReplies pings the given host (host) tries times. The replies are counted and returned.

Parameters:
host - host to ping
tries - number of pings to send
Returns:
number of ping replies received
Throws:
java.io.IOException - if an I/O error occurs

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Test program entry point.

Details: main is the program entry point for the stand-alone compatibility test.

Parameters:
args - command line arguments

Sharkysoft home