Add a constant rate setting function to the on-off helper
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user