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

Eddie Kohler kohler at cs.ucla.edu
Mon Jun 15 01:23:34 EDT 2009


Most likely you did not give the element's initialize() function the right
argument types, or something along these lines.  This would cause the
initialize() method to not get called.  Make sure it's

int initialize(ErrorHandler *errh);

Eddie


竺昱 wrote:
> Yes, I have already put _timer.initialize(this) in the initialize
> method of this element.
> I think this initialize method is not called.
> it still reports "void Timer::schedule_at(const Timestamp&): Assertion
> `_router && initialized()' failed."
> 
> Could you tell me when the initialize method of an element will be called?
> Thank you very much
> 
> 2009/5/20 Bart Braem <bart.braem at ua.ac.be>:
>> 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
>>
>>
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click



More information about the click mailing list