net.clackrouter.application
Class Ping

java.lang.Object
  extended by java.lang.Thread
      extended by net.clackrouter.application.ClackApplication
          extended by net.clackrouter.application.Ping
All Implemented Interfaces:
java.lang.Runnable, ICMPListener, Alarm

public class Ping
extends ClackApplication
implements ICMPListener

A simplified version of the "ping" command to send ICMP echo requests to a remote host.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static int SLEEP_TIME_MSEC
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Ping()
           
 
Method Summary
 void application_main(java.lang.String[] args)
          Abstract "main method" to be implemented by sub-class
 java.lang.String getDescription()
          Returns a very brief (single line) description of the application
 void receivedEchoReply(int id, int seq)
           
 void receivedEchoRequest(int id, int seq)
           
 
Methods inherited from class net.clackrouter.application.ClackApplication
alert, configure, createTCPSocket, createUDPSocket, getAppName, getRouter, getTime, notifyAlarm, pause, print, run, setAlarm, setShell
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SLEEP_TIME_MSEC

public static int SLEEP_TIME_MSEC
Constructor Detail

Ping

public Ping()
Method Detail

application_main

public void application_main(java.lang.String[] args)
                      throws java.lang.InterruptedException
Description copied from class: ClackApplication
Abstract "main method" to be implemented by sub-class

Specified by:
application_main in class ClackApplication
Parameters:
args - the application arguments
Throws:
java.lang.InterruptedException

receivedEchoReply

public void receivedEchoReply(int id,
                              int seq)
Specified by:
receivedEchoReply in interface ICMPListener

receivedEchoRequest

public void receivedEchoRequest(int id,
                                int seq)
Specified by:
receivedEchoRequest in interface ICMPListener

getDescription

public java.lang.String getDescription()
Description copied from class: ClackApplication
Returns a very brief (single line) description of the application

Specified by:
getDescription in class ClackApplication