util
Class Pinger

java.lang.Object
  extended by util.Pinger

public class Pinger
extends Object

Class to use the platform-based ping to obtain reply times for a given host. Warning: As ping rans normally under root privileges, care should be taken when using this code!


Field Summary
 double avReply
           
 InetAddress host
           
 double maxReply
           
 double minReply
           
 double packageLoss
           
static int PACKNR
           
 Date testTime
           
 
Constructor Summary
Pinger()
           
Pinger(String hostname)
           
Pinger(String hostname, int packnr)
           
Pinger(URL hostsite)
           
 
Method Summary
static void main(String[] arg)
           
 void test()
           
 void test(int packnr)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PACKNR

public static final int PACKNR
See Also:
Constant Field Values

packageLoss

public double packageLoss

minReply

public double minReply

maxReply

public double maxReply

avReply

public double avReply

testTime

public Date testTime

host

public InetAddress host
Constructor Detail

Pinger

public Pinger()

Pinger

public Pinger(URL hostsite)
       throws IOException,
              InterruptedException
Parameters:
hostsite -
Throws:
IOException
InterruptedException

Pinger

public Pinger(String hostname)
       throws IOException,
              InterruptedException
Parameters:
hostname -
Throws:
IOException
InterruptedException

Pinger

public Pinger(String hostname,
              int packnr)
       throws IOException,
              InterruptedException
Parameters:
hostname -
packnr -
Throws:
IOException
InterruptedException
Method Detail

test

public void test()
          throws IOException,
                 InterruptedException
Throws:
IOException
InterruptedException

test

public void test(int packnr)
          throws IOException,
                 InterruptedException
Parameters:
packnr -
Throws:
IOException
InterruptedException

toString

public String toString()
Overrides:
toString in class Object
Returns:
String

main

public static void main(String[] arg)
                 throws IOException,
                        InterruptedException
Parameters:
arg -
Throws:
IOException
InterruptedException