make sure that the sinks are started

This commit is contained in:
Mathieu Lacage
2008-09-23 16:31:54 -07:00
parent a7b4e36b84
commit fbf3dd3cf7
2 changed files with 14 additions and 11 deletions

View File

@@ -127,19 +127,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 (terminals.Get (1));
app = sink.Install (terminals.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 (Ipv4Address ("10.1.1.1"), port)));
ApplicationContainer app2 = onoff.Install (terminals.Get (3));
app = onoff.Install (terminals.Get (3));
app.Start (Seconds (1.1));
app.Stop (Seconds (10.0));
sink.Install (terminals.Get (0));
app = sink.Install (terminals.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.

View File

@@ -107,19 +107,20 @@ def main(argv):
# Create an optional packet sink to receive these packets
sink = ns3.PacketSinkHelper("ns3::UdpSocketFactory",
ns3.Address(ns3.InetSocketAddress(ns3.Ipv4Address.GetAny(), port)))
sink.Install(ns3.NodeContainer(terminals.Get(1)))
app = sink.Install(ns3.NodeContainer(terminals.Get(1)))
app.Start (ns3.Seconds (0.0))
#
# Create a similar flow from n3 to n0, starting at time 1.1 seconds
#
onoff.SetAttribute("Remote",
ns3.AddressValue(ns3.InetSocketAddress(ns3.Ipv4Address("10.1.1.1"), port)))
app2 = onoff.Install(ns3.NodeContainer(terminals.Get(3)))
app = onoff.Install(ns3.NodeContainer(terminals.Get(3)))
app.Start(ns3.Seconds(1.1))
app.Stop(ns3.Seconds(10.0))
sink.Install(ns3.NodeContainer(terminals.Get(0)))
app2.Start(ns3.Seconds(1.1))
app2.Stop(ns3.Seconds(10.0))
app = sink.Install(ns3.NodeContainer(terminals.Get(0)))
app.Start (ns3.Seconds (0.0))
#
# Configure tracing of all enqueue, dequeue, and NetDevice receive events.