<br><font size=2 face="sans-serif">Good suggestion, doesn't seem to fix
my problem though. &nbsp;Actually, to debug this I went back to something
even simpler which is giving me strange results. &nbsp;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, &amp;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. &nbsp;[I know setting the join_timer in not_joined_state doesn't
make sense for PIM but this is just to debug]. &nbsp;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 &lt;greearb@candelatech.com&gt;</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">&quot;xorp-users@xorp.org&quot;
&lt;xorp-users@xorp.org&gt;</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>
&gt;<br>
&gt; Hi Hackers,<br>
&gt;<br>
&gt; 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>
&gt; 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>
&gt;<br>
&gt; Pim_Mre_Join_Prune::recompute_is_prune_desired_****<br>
&gt;<br>
&gt; TimeVal timeval = TimeVal(30,0);<br>
&gt;<br>
&gt; ...<br>
&gt;<br>
&gt; set_pruned_state();<br>
&gt;<br>
&gt; new_timer() =<br>
&gt; pim_node().eventloop().new_oneoff_after(<br>
&gt; timeval,<br>
&gt; callback(this, &amp;PimMre::new_timer_timeout));<br>
&gt;<br>
&gt;<br>
&gt; //Later on...<br>
&gt; void<br>
&gt; PimMre::new_timer_timeout()<br>
&gt; {<br>
&gt; XLOG_TRACE(true, &quot;New timer fired.&quot;);<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt; PimMre.hh:<br>
&gt;<br>
&gt; XorpTimer&amp; new_timer() { return(_new_timer); }<br>
&gt; constXorpTimer&amp; const_new_timer() const{<br>
&gt; return(_new_timer);<br>
&gt; }<br>
&gt;<br>
&gt; XorpTimer _new_timer;<br>
&gt;<br>
&gt; //function to be called<br>
&gt; voidnew_timer_timeout();<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 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>
&gt; (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>
&gt; 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>
&gt;<br>
&gt; Any ideas? Thanks!<br>
&gt;<br>
&gt; S. Dickey<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Xorp-users mailing list<br>
&gt; Xorp-users@xorp.org<br>
&gt; http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-users<br>
<br>
<br>
-- <br>
Ben Greear &lt;greearb@candelatech.com&gt;<br>
Candela Technologies Inc &nbsp;http://www.candelatech.com<br>
</tt></font>
<br>