examples/tcp/tcp-nsc-lfn.cc
changeset 8966 060dba23e9bb
parent 7256 b04ba6772f8c
child 8986 3391f6a7fb3b
equal deleted inserted replaced
8965:cfed4f87e003 8966:060dba23e9bb
   123   // This sets up two TCP flows, one from A -> B, one from B -> A.
   123   // This sets up two TCP flows, one from A -> B, one from B -> A.
   124   for (int i = 0, j = 1; i < 2; j--, i++)
   124   for (int i = 0, j = 1; i < 2; j--, i++)
   125     {
   125     {
   126       Address remoteAddress (InetSocketAddress (ipv4Interfaces.GetAddress (i), servPort));
   126       Address remoteAddress (InetSocketAddress (ipv4Interfaces.GetAddress (i), servPort));
   127       OnOffHelper clientHelper ("ns3::TcpSocketFactory", remoteAddress);
   127       OnOffHelper clientHelper ("ns3::TcpSocketFactory", remoteAddress);
   128       clientHelper.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
   128       clientHelper.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
   129       clientHelper.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
   129       clientHelper.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
   130       ApplicationContainer clientApp = clientHelper.Install (n.Get (j));
   130       ApplicationContainer clientApp = clientHelper.Install (n.Get (j));
   131       clientApp.Start (Seconds (1.0 + i));
   131       clientApp.Start (Seconds (1.0 + i));
   132       clientApp.Stop (Seconds (runtime + 1.0 + i));
   132       clientApp.Stop (Seconds (runtime + 1.0 + i));
   133     }
   133     }
   134 
   134