[Click] nsclick: Bug when starting timers from within writehandlers

Erwin Van de Velde erwin.vandevelde at ua.ac.be
Thu Dec 3 05:12:57 EST 2009


Dear all,

If you are using nsclick and you try to activate a timer in an element by 
calling a write handler from the TCL script, something goes wrong with the 
scheduling and all timers and tasks stop functioning properly.

Example click script:
source::ICMPPingSource(2.0.0.2, 1.0.0.2, ACTIVE false) -> Print("in") -> Queue 
-> Unqueue-> Print("out") ->Discard;

Just use a TCL script with at least one node, running this click script and 
activate the ICMPPingSource with a line like this:
$ns_ at 10 " [$node_($i) set classifier_] writehandler \"source\" \"active\" 
\"true\" "

If you activate the ICMPPingSource at configuration time, everything works fine.

It took me a while and a lot of help from Michael to find out why my 
simulations kept acting strange, but now I found a workaround: starting all 
timers in the beginning and just do nothing when the timer expires unless a 
certain boolean is set (which can be done without problems using the write 
handler). However, I think I am not the only one trying something like this 
and if the bug would be solved, it could save a lot of time. Unfortunately I 
am not familiar enough with the nsclick internals to do this, so I hope 
someone can lend me a hand here.

Best regards,
Erwin


More information about the click mailing list