util
Class Pinger
java.lang.Object
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!
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
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
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