> To: [email protected]
> CC: [email protected]
> Subject: Re: [Xorp-hackers] Timer Event 
> Date: Wed, 11 Mar 2009 02:07:08 -0700
> From: [email protected]
> 
> michael anonyme <[email protected]> wrote:
> 
> > 
> > Hello,
> > 
> > I'm trying to add an event to the EventLoop : 
> > 
> > _timeOutVal(TimeVal(10,0)) is initialized in constructor.
> > 
> > I would like that after 10 seconds, Xorp run test_cb method, but it doesn't 
> > seems to work.
> > 
> > XorpTimer t = 
> > _eventloop.new_oneoff_after(_timeOutVal,callback(this,&ConsensusMain::test_cb));
> > 
> > void ConsensusMain::test_cb() {
> >        XLOG_INFO("RUN TEST CALLBACK!!!!!\n");
> > }
> > 
> > What did I do wrong??
> 
> If the "XorpTime t" object is destroyed (e.g., if it goes out of
> scope), then the timer itself on the eventloop is also destroyed.
> You need to save it somewhere (e.g., as a private field in the
> ConsensusMain class).
> 
> Hope that helps,
> Pavlin

Thanks it works great!!

_________________________________________________________________
Découvrez la nouvelle génération des servives de Windows Live
http://download.live.com
_______________________________________________
Xorp-hackers mailing list
[email protected]
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers

Reply via email to