Timer Element in Click
Shweta Bhandare
Shweta.Bhandare at colorado.edu
Wed Apr 3 11:45:41 EST 2002
HI Eddie,
We figured that out later. But thanks for your help. We used the Timer
element just like the Task element.
Thanks,
Shweta
-----Original Message-----
From: Eddie Kohler [mailto:kohler at icir.org]
Sent: Wednesday, April 03, 2002 11:09 AM
To: Shweta.Bhandare at colorado.edu
Cc: click at amsterdam.lcs.mit.edu
Subject: Re: Timer Element in Click
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