Timer Element in Click
Eddie Kohler
kohler at icir.org
Wed Apr 3 10:08:37 EST 2002
Hi Shweta,
When you construct a Timer object, you supply a hook to be called when the
timer goes off. The most general constructor is:
Timer(TimerHook h, void *thunk)
where
typedef void (*TimerHook)(Timer *, void *);
Then when the 'timer' goes off, the TimerHook 'h' will be called as
follows:
h(timer, thunk);
The constructors you mention supply their own hooks for convenience.
"Timer(Element *e)" calls 'e->run_scheduled()' when the timer goes off.
"Timer(Task *t)" calls 't->reschedule()' when the timer goes off.
Hope this helps!
Eddie
More information about the click
mailing list