View | Details | Raw Unified | Return to bug 411
Collapse All | Expand All

(-)a/src/applications/onoff/onoff-application.cc (-2 / +4 lines)
 Lines 177-189    Link Here 
177
  NS_LOG_FUNCTION_NOARGS ();
177
  NS_LOG_FUNCTION_NOARGS ();
178
178
179
  ScheduleNextTx();  // Schedule the send packet event
179
  ScheduleNextTx();  // Schedule the send packet event
180
  ScheduleStopEvent();
180
}
181
}
181
182
182
void OnOffApplication::StopSending()
183
void OnOffApplication::StopSending()
183
{
184
{
184
  NS_LOG_FUNCTION_NOARGS ();
185
  NS_LOG_FUNCTION_NOARGS ();
186
  CancelEvents();
185
187
186
  Simulator::Cancel(m_sendEvent);
188
  ScheduleStartEvent();
187
}
189
}
188
190
189
// Private helpers
191
// Private helpers
 Lines 222-228    Link Here 
222
224
223
  Time onInterval = Seconds(m_onTime.GetValue());
225
  Time onInterval = Seconds(m_onTime.GetValue());
224
  NS_LOG_LOGIC ("stop at " << onInterval);
226
  NS_LOG_LOGIC ("stop at " << onInterval);
225
  Simulator::Schedule(onInterval, &OnOffApplication::StopSending, this);
227
  m_startStopEvent = Simulator::Schedule(onInterval, &OnOffApplication::StopSending, this);
226
}
228
}
227
229
228
  
230
  

Return to bug 411