Add a constant rate setting function to the on-off helper

This commit is contained in:
Mitch Watrous
2012-08-23 16:00:17 -07:00
parent 6fb3fb3b99
commit eafb5075bf
41 changed files with 79 additions and 118 deletions

View File

@@ -116,9 +116,7 @@ main (int argc, char *argv[])
OnOffHelper onoff ("ns3::UdpSocketFactory",
Address (InetSocketAddress (i3i2.GetAddress (1), port)));
onoff.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
onoff.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
onoff.SetConstantRate (DataRate ("448kb/s"));
ApplicationContainer apps = onoff.Install (c.Get (0));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));