From f8bbbbc89944bda2e2b81c1a7aed2d59a26ec1c9 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Tue, 23 Sep 2008 16:38:51 -0700 Subject: [PATCH] make sure sinks are started --- examples/csma-one-subnet.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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"