<br><font size=2 face="sans-serif">Good suggestion, doesn't seem to fix
my problem though. Actually, to debug this I went back to something
even simpler which is giving me strange results. I just copied the
join_timer code:</font>
<br>
<br><font size=2><tt>join_timer() =<br>
pim_node().eventloop().new_oneoff_after(<br>
TimeVal(join_prune_period, 0);<br>
callback(this, &PimMre::join_timer_timeout));</tt></font>
<br>
<br><font size=2><tt>I added that code right before the pim_mre_join_prune::recompute_is_join_desired_****
methods call set_not_joined_state() and commented out all the join_timer().unschedule()
calls. [I know setting the join_timer in not_joined_state doesn't
make sense for PIM but this is just to debug]. The join_timer won't
fire when called during pruned state. This is the same code snippet which
will successfully fire the join_timer() if we are in joined_state.</tt></font>
<br>
<br><font size=2><tt>Is something stopping timers from firing when they
are started in the not_joined / pruned state? </tt></font>
<br>
<br><font size=2><tt>S Dickey.</tt></font>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Ben Greear <greearb@candelatech.com></b>
</font>
<p><font size=1 face="sans-serif">01/09/2011 04:35 PM</font>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">swdickey@rockwellcollins.com</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top><font size=1 face="sans-serif">"xorp-users@xorp.org"
<xorp-users@xorp.org></font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">Re: [Xorp-users] My new XorpTimer
not working in PIM</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>On 09/01/2011 12:50 PM, swdickey@rockwellcollins.com
wrote:<br>
><br>
> Hi Hackers,<br>
><br>
> I am trying out some code inside the pim_mre_join_prune::recompute_is_prune_desired_***
methods. After every set_pruned_state() call I want to set my new timer<br>
> to fire every 30 seconds or so. This is the code I am using, its pretty
much identical to the join_timer() which is why I'm confused that it doesn't
work.<br>
><br>
> Pim_Mre_Join_Prune::recompute_is_prune_desired_****<br>
><br>
> TimeVal timeval = TimeVal(30,0);<br>
><br>
> ...<br>
><br>
> set_pruned_state();<br>
><br>
> new_timer() =<br>
> pim_node().eventloop().new_oneoff_after(<br>
> timeval,<br>
> callback(this, &PimMre::new_timer_timeout));<br>
><br>
><br>
> //Later on...<br>
> void<br>
> PimMre::new_timer_timeout()<br>
> {<br>
> XLOG_TRACE(true, "New timer fired.");<br>
> }<br>
><br>
><br>
> PimMre.hh:<br>
><br>
> XorpTimer& new_timer() { return(_new_timer); }<br>
> constXorpTimer& const_new_timer() const{<br>
> return(_new_timer);<br>
> }<br>
><br>
> XorpTimer _new_timer;<br>
><br>
> //function to be called<br>
> voidnew_timer_timeout();<br>
><br>
><br>
><br>
> This code will run and will set the timer (new_timer().scheduled ==
true) but the timer will never fire! Interestingly, if I change the time
to 5 milliseconds<br>
> (TimeVal timeval = TimeVal(0,5);) then the new_timer will fire. I'm
not sure if this is a timing issue or some memory is going out of scope
and the 5 msec will<br>
> fire the timer before the memory is overwritten.<br>
<br>
Maybe the callback method needs to be a static method or plain<br>
function instead of a class member?<br>
<br>
Thanks,<br>
Ben<br>
<br>
><br>
> Any ideas? Thanks!<br>
><br>
> S. Dickey<br>
><br>
><br>
> _______________________________________________<br>
> Xorp-users mailing list<br>
> Xorp-users@xorp.org<br>
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-users<br>
<br>
<br>
-- <br>
Ben Greear <greearb@candelatech.com><br>
Candela Technologies Inc http://www.candelatech.com<br>
</tt></font>
<br>