[Xorp-hackers] adding a function to eventloop
Atanu Ghosh
atanu at ICSI.Berkeley.EDU
Thu Jun 19 13:47:53 PDT 2008
Hi,
When your timer object "get_LSD_timer" is destroyed the timer is
killed. Make "get_LSD_timer" a member variable of the the class
XrlpnameNode and the timer will be called.
Atanu.
Selçuk Cevher <cevhers at gmail.com> wrote:
>
> Hi All,
>
>
>
> I have a problem regarding xorp eventloop mechanism.
>
>
>
> I am trying to add a function called pname of a new xorp process
> called pname to the same process's eventloop.
>
>
>
> The function is supposed to periodically obtain the link state
> database from ospfV2.
>
>
>
> I used the following function to add the function to the eventloop:
>
>
>
> void
> XrlpnameNode::add_to_eventloop()
>
> {
> XorpTimer get_LSD_timer;
>
> get_LSD_timer.unschedule();
>
> get_LSD_timer = _eventloop.new_periodic_ms(10000, callback(this,
> &XrlpnameNode::function_to_be_added_to_eventloop));
>
> }
>
>
>
> XrlpnameNode::add_to_eventloop() is called by the main function of the
> process, right before entering the main loop of the process.
> (_eventloop is set properly within the constructor of XrlpnameNode).
> As can be seen, function_to_be_added_to_eventloop is also defined in
> XrlpnameNode class.
>
>
>
> The problem is that the function function_to_be_added_to_eventloop is
> not executed by the eventloop of the process pname.
>
>
>
> Anyone has an idea what I am missing ?
>
>
>
> Thanks,
>
> Selcuk
> _______________________________________________
> Xorp-hackers mailing list
> Xorp-hackers at icir.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers
More information about the Xorp-hackers
mailing list