[Click] how to link use timer or pthread in my element?

Bart Braem bart.braem at ua.ac.be
Wed May 20 05:51:29 EDT 2009


Hi,

Regarding your first question:

On 14 May 2009, at 15:36, 竺昱 wrote:

> 1. I implenment a class for for entry in routing table and put a Timer
> in the class. I expect it can update the infomation in the entry
> periodly. so I made this class to be a element class (classname:
> public element) to match Timer(Element*), but this is not a element
> processes packets. I do not know if there is any problem. And there is
> a runtime errors says that:
>    click: ../lib/timer.cc:167: void Timer::schedule_at(const
> Timestamp&): Assertion `_router && initialized()' failed.


Did you properly initialize your timer? You need to construct your  
timer in the element constructor, and then in the initialize method of  
your element you need to initialize it using  
Timer::initialize(Element*).
Doing no packet processing in an element will have no effect on this,  
it is perfectly possible to have a routing table that is just an  
infobase element while maintaining timers.

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




More information about the click mailing list