[Click] Problem with Timers

Bart Braem bart.braem at ua.ac.be
Mon Feb 9 05:38:24 EST 2009


Hello,

You can call the timer's initialize function with a Router argument,  
so you could do that in MyNullEntry::initialize.
There is no need to inherit from Element if you are not going to use a  
class as an element, i.e. if you are not going to send or receive  
packets in it. So you could easily stop inheriting and add a Router  
argument to the constructor of a MyNullEntry object.

Regards,
Bart

On 07 Feb 2009, at 12:51, Angelo Colucci wrote:

> Hello Bart,
>
> Thanks for your help. You are right, in fact in my  .click file I  
> intentionally obmit declaration
> of MyNullEntry element. In my intention i would create a MyNullEntry  
> only after the Machine
> have received and correctly processed an open-request frame from  
> Peer Mesh STA.
> MyNullEntry Table serves as a database of  opening/opened link.
> I had to write MyNullEntry as a subclass of Element  because i want  
> associate a timer to each
> MyNullEntry.
> If i want to solve the binding between MyNullEntry elements and a  
> router,
> can i make MyNullEntry as a package and specify require statement  
> in .click file?
>
>
> cheers,
>
> Angelo
>
>
>
> 2009/2/6 Bart Braem <bart.braem at ua.ac.be>
> Hello,
>
> You are initializing MyNullEntry elements in your code, without  
> binding theme to a router.
>
>
> On 05 Feb 2009, at 20:44, Angelo Colucci wrote:
>
> int MyNullEntry::initialize(ErrorHandler* errh){
>   click_chatter("initialize MyNullEntry\n");
>   _timer = new Timer(this);
>   if(!_timer){
>       click_chatter("Timer: new error\n");
>       return -1;
>   }
>   _timer->initialize(this);
>   return 0;
> }
>
> My guess is that then this initialize code does not work, which  
> explains your problems.
>
> Regards,
> Bart Braem
> -- 
> Bart Braem
> PATS research group - IBBT
> Dept. of Mathematics and Computer Sciences
> University of Antwerp
> Campus Middelheim, G3.30
> Middelheimlaan 1
> B-2020 Antwerpen, Belgium
> Phone: +32 (0)3 265.32.91
> Fax: +32 (0)3 265.37.77
> Web: www.pats.ua.ac.be
>
>

Mvg,
Bart Braem
-- 
Bart Braem
PATS research group - IBBT
Dept. of Mathematics and Computer Sciences
University of Antwerp
Campus Middelheim, G3.30
Middelheimlaan 1
B-2020 Antwerpen, Belgium
Phone: +32 (0)3 265.32.91
Fax: +32 (0)3 265.37.77
Web: www.pats.ua.ac.be



More information about the click mailing list