diff --git a/examples/csma-one-subnet.cc b/examples/csma-one-subnet.cc index 28d1f403b..ea74763c8 100644 --- a/examples/csma-one-subnet.cc +++ b/examples/csma-one-subnet.cc @@ -103,19 +103,21 @@ main (int argc, char *argv[]) // Create an optional packet sink to receive these packets PacketSinkHelper sink ("ns3::UdpSocketFactory", Address (InetSocketAddress (Ipv4Address::GetAny (), port))); - sink.Install (nodes.Get (1)); + app = sink.Install (nodes.Get (1)); + app.Start (Seconds (0.0)); // // Create a similar flow from n3 to n0, starting at time 1.1 seconds // onoff.SetAttribute ("Remote", AddressValue (InetSocketAddress (interfaces.GetAddress (0), port))); - ApplicationContainer app2 = onoff.Install (nodes.Get (3)); + app = onoff.Install (nodes.Get (3)); + app.Start(Seconds (1.1)); + app.Stop (Seconds (10.0)); - sink.Install (nodes.Get (0)); + app = sink.Install (nodes.Get (0)); + app.Start (Seconds (0.0)); - app2.Start(Seconds (1.1)); - app2.Stop (Seconds (10.0)); // // Configure tracing of all enqueue, dequeue, and NetDevice receive events. // Trace output will be sent to the file "csma-one-subnet.tr"