com.veraxsystems.icmp.ping.handlers
Class Sender

java.lang.Object
  extended by com.veraxsystems.icmp.ping.handlers.Sender
All Implemented Interfaces:
java.lang.Runnable

public class Sender
extends java.lang.Object
implements java.lang.Runnable

An ICMP sending thread implementation. The class is a {link IcmpJniBridge} sender used in Ping class. It handles list of ICMP requests that are registered by registerRequest method. Once request is registered by, it is sent in thread activity loop and than passed to Receiver for future handling.


Constructor Summary
Sender(Receiver receiverVal, IcmpJniBridge icmpVal)
          Constructor accepts IcmpJniBridge object that is used to send ICMP messages and Receiver that is used to pass request for further handling.
 
Method Summary
 void registerRequest(PingRequest pingRequest)
          Register ICMP EchoRequest and put it into requests queue.
 void run()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sender

public Sender(Receiver receiverVal,
              IcmpJniBridge icmpVal)
Constructor accepts IcmpJniBridge object that is used to send ICMP messages and Receiver that is used to pass request for further handling. Because ICMP echo is send request is forwarded to

Parameters:
receiverVal - receiving ICMP response handler
icmpVal - ICMP socket
Method Detail

registerRequest

public void registerRequest(PingRequest pingRequest)
                     throws PingErrorException
Register ICMP EchoRequest and put it into requests queue.

Parameters:
pingRequest - the ICMP descriptor
Throws:
PingErrorException - exception is thrown if Sender object is disposed

run

public void run()
Specified by:
run in interface java.lang.Runnable