examples/udp-echo.cc
changeset 3382 d5f8e5fae1c6
parent 3381 3cdd9d60f7c7
child 3506 cba7b2b80fe8
--- a/examples/udp-echo.cc	Thu Jul 03 15:44:54 2008 -0700
+++ b/examples/udp-echo.cc	Thu Jul 03 17:37:32 2008 -0700
@@ -104,8 +104,7 @@
 // Create a UdpEchoServer application on node one.
 //
   uint16_t port = 9;  // well-known echo port number
-  UdpEchoServerHelper server;
-  server.SetPort (port);
+  UdpEchoServerHelper server (port);
   ApplicationContainer apps = server.Install (n.Get(1));
   apps.Start (Seconds (1.0));
   apps.Stop (Seconds (10.0));
@@ -117,11 +116,10 @@
   uint32_t packetSize = 1024;
   uint32_t maxPacketCount = 1;
   Time interPacketInterval = Seconds (1.);
-  UdpEchoClientHelper client;
-  client.SetRemote (i.GetAddress (1), port);
-  client.SetAppAttribute ("MaxPackets", UintegerValue (maxPacketCount));
-  client.SetAppAttribute ("Interval", TimeValue (interPacketInterval));
-  client.SetAppAttribute ("PacketSize", UintegerValue (packetSize));
+  UdpEchoClientHelper client (i.GetAddress (1), port);
+  client.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount));
+  client.SetAttribute ("Interval", TimeValue (interPacketInterval));
+  client.SetAttribute ("PacketSize", UintegerValue (packetSize));
   apps = client.Install (n.Get (0));
   apps.Start (Seconds (2.0));
   apps.Stop (Seconds (10.0));