bug 411 -- apply Raj's patch
authorraj.b@gatech.edu
Tue, 09 Dec 2008 12:24:24 -0800
changeset 39962277ff80158c
parent 3995 9bda1a9c0eb2
child 3997 a66553c56a8f
bug 411 -- apply Raj's patch
src/applications/onoff/onoff-application.cc
     1.1 --- a/src/applications/onoff/onoff-application.cc	Tue Dec 09 12:04:36 2008 -0800
     1.2 +++ b/src/applications/onoff/onoff-application.cc	Tue Dec 09 12:24:24 2008 -0800
     1.3 @@ -177,13 +177,15 @@
     1.4    NS_LOG_FUNCTION_NOARGS ();
     1.5  
     1.6    ScheduleNextTx();  // Schedule the send packet event
     1.7 +  ScheduleStopEvent();
     1.8  }
     1.9  
    1.10  void OnOffApplication::StopSending()
    1.11  {
    1.12    NS_LOG_FUNCTION_NOARGS ();
    1.13 +  CancelEvents();
    1.14  
    1.15 -  Simulator::Cancel(m_sendEvent);
    1.16 +  ScheduleStartEvent();
    1.17  }
    1.18  
    1.19  // Private helpers
    1.20 @@ -222,7 +224,7 @@
    1.21  
    1.22    Time onInterval = Seconds(m_onTime.GetValue());
    1.23    NS_LOG_LOGIC ("stop at " << onInterval);
    1.24 -  Simulator::Schedule(onInterval, &OnOffApplication::StopSending, this);
    1.25 +  m_startStopEvent = Simulator::Schedule(onInterval, &OnOffApplication::StopSending, this);
    1.26  }
    1.27  
    1.28