From ec2b71250000f536e42d1ddf3688015c58d2b284 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Fri, 8 Jan 2010 18:04:01 +0100 Subject: [PATCH] bug 752: Object::DoStart is not executed for objects created at t > 0 --- src/node/node.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/node/node.cc b/src/node/node.cc index 72c85f194..8867cefa9 100644 --- a/src/node/node.cc +++ b/src/node/node.cc @@ -30,6 +30,7 @@ #include "ns3/assert.h" #include "ns3/global-value.h" #include "ns3/boolean.h" +#include "ns3/simulator.h" NS_LOG_COMPONENT_DEFINE ("Node"); @@ -108,6 +109,8 @@ Node::AddDevice (Ptr device) device->SetNode (this); device->SetIfIndex(index); device->SetReceiveCallback (MakeCallback (&Node::NonPromiscReceiveFromDevice, this)); + Simulator::ScheduleWithContext (GetId (), Seconds (0.0), + &NetDevice::Start, device); NotifyDeviceAdded (device); return index; } @@ -130,6 +133,8 @@ Node::AddApplication (Ptr application) uint32_t index = m_applications.size (); m_applications.push_back (application); application->SetNode (this); + Simulator::ScheduleWithContext (GetId (), Seconds (0.0), + &Application::Start, application); return index; } Ptr