src/mpi/examples/simple-distributed.cc
changeset 7252 c8200621e252
parent 7203 90a20d9a0fee
child 8997 9222fc5291ca
equal deleted inserted replaced
7251:b2fe610ad03f 7252:c8200621e252
   224   // Create the OnOff applications to send
   224   // Create the OnOff applications to send
   225   if (systemId == 0)
   225   if (systemId == 0)
   226     {
   226     {
   227       OnOffHelper clientHelper ("ns3::UdpSocketFactory", Address ());
   227       OnOffHelper clientHelper ("ns3::UdpSocketFactory", Address ());
   228       clientHelper.SetAttribute
   228       clientHelper.SetAttribute
   229                                 ("OnTime", RandomVariableValue (ConstantVariable (1)));
   229         ("OnTime", RandomVariableValue (ConstantVariable (1)));
   230       clientHelper.SetAttribute
   230       clientHelper.SetAttribute
   231                                 ("OffTime", RandomVariableValue (ConstantVariable (0)));
   231         ("OffTime", RandomVariableValue (ConstantVariable (0)));
   232 
   232 
   233       ApplicationContainer clientApps;
   233       ApplicationContainer clientApps;
   234       for (uint32_t i = 0; i < 4; ++i)
   234       for (uint32_t i = 0; i < 4; ++i)
   235         {
   235         {
   236           AddressValue remoteAddress
   236           AddressValue remoteAddress
   237                                 (InetSocketAddress (rightLeafInterfaces.GetAddress (i), port));
   237             (InetSocketAddress (rightLeafInterfaces.GetAddress (i), port));
   238           clientHelper.SetAttribute ("Remote", remoteAddress);
   238           clientHelper.SetAttribute ("Remote", remoteAddress);
   239           clientApps.Add (clientHelper.Install (leftLeafNodes.Get (i)));
   239           clientApps.Add (clientHelper.Install (leftLeafNodes.Get (i)));
   240         }
   240         }
   241       clientApps.Start (Seconds (1.0));
   241       clientApps.Start (Seconds (1.0));
   242       clientApps.Stop (Seconds (5));
   242       clientApps.Stop (Seconds (5));