Class SmartRoute
java.lang.Object
|
+----magician.Node.KU_SmartPacket_V2
|
+----SmartRoute
- public class SmartRoute
- extends KU_SmartPacket_V2
This packet sends a "ping" to the destination machine.
It is created by extending the base KU_SmartPacket_V2 class and
overriding the exec() method of the base class with the logic
of the "ping" application. The packet uses
the node default routing protocol to route itself to the destination.
Upon reaching the destination, it reverses direction and heads back to
the node from which it originated. The round trip time is then calculated
and printed out. It can also be changed to record the route
taken by uncommenting the appropriate lines of code in the source of this class.
-
SmartRoute()
- initializes the object
-
exec()
- The logic for the ping application goes in here.
-
finalize()
- garbage collection
SmartRoute
public SmartRoute()
- initializes the object
exec
public void exec()
- The logic for the ping application goes in here. The start time is noted
and the packet is forwarded to the next hop towards its destination using
the default routing protocol. When it reaches the destination, the field
Destination_Address of the KU_SmartPacket_V2 class is replaced with the
name of the source node, available from the Source_Address field.
- Overrides:
- exec in class KU_SmartPacket_V2
- See Also:
- KU_SmartPacket_V2
finalize
protected void finalize()
- garbage collection
- Overrides:
- finalize in class Object