# HG changeset patch # User raj.b@gatech.edu # Date 1228854264 28800 # Node ID 2277ff80158c46ca1a48e0aeb82651e97a095f29 # Parent 9bda1a9c0eb2cec4eeb83d793c554f0e5454a92c bug 411 -- apply Raj's patch diff -r 9bda1a9c0eb2 -r 2277ff80158c src/applications/onoff/onoff-application.cc --- a/src/applications/onoff/onoff-application.cc Tue Dec 09 12:04:36 2008 -0800 +++ b/src/applications/onoff/onoff-application.cc Tue Dec 09 12:24:24 2008 -0800 @@ -177,13 +177,15 @@ NS_LOG_FUNCTION_NOARGS (); ScheduleNextTx(); // Schedule the send packet event + ScheduleStopEvent(); } void OnOffApplication::StopSending() { NS_LOG_FUNCTION_NOARGS (); + CancelEvents(); - Simulator::Cancel(m_sendEvent); + ScheduleStartEvent(); } // Private helpers @@ -222,7 +224,7 @@ Time onInterval = Seconds(m_onTime.GetValue()); NS_LOG_LOGIC ("stop at " << onInterval); - Simulator::Schedule(onInterval, &OnOffApplication::StopSending, this); + m_startStopEvent = Simulator::Schedule(onInterval, &OnOffApplication::StopSending, this); }