- Home Page of ProjectGuideline.com ›
- Forums ›
- Get Help to do your B.E., and M.E., M.Tech., & M.S., Project in Ns2 ›
- tcl code
suz
Participant
sir,
could anyone present explain in detail what does the following lines do especially the first two lines.
Agent/Ping instproc recv {from rtt} {
$self instvar node_
puts “node [$node_ id] received ping answer from
$from with round-trip-time $rtt ms.”
}
CharlesPandian
Keymaster
Agent/Ping instproc recv {from rtt} {
$self instvar node_
puts "node [$node_ id] received ping answer from $from with round-trip-time $rtt ms."
}
If the PningAgnet is receiving a ping reply, then the control will enter this block of code and this print command(puts) will print that info (in console/terminal). “from and rtt” are the two parameters supplied to this function.