make simple example work
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 12 Feb 2007 19:52:01 +0100
changeset 250 82e03c8debf5
parent 249 66f64be80982
child 251 caea4ced7571
make simple example work
samples/main-simple.cc
src/node/ipv4-loopback-interface.cc
--- a/samples/main-simple.cc	Mon Feb 12 19:47:36 2007 +0100
+++ b/samples/main-simple.cc	Mon Feb 12 19:52:01 2007 +0100
@@ -33,8 +33,12 @@
 static void
 GenerateTraffic (UdpSocket *socket, uint32_t size)
 {
+  std::cout << "at=" << Simulator::Now ().GetSeconds () << "s, tx bytes=" << size << std::endl;
   socket->SendDummy (size);
-  Simulator::Schedule (Seconds (0.5), &GenerateTraffic, socket, size - 50);
+  if (size > 0)
+    {
+      Simulator::Schedule (Seconds (0.5), &GenerateTraffic, socket, size - 50);
+    }
 }
 
 static void
--- a/src/node/ipv4-loopback-interface.cc	Mon Feb 12 19:47:36 2007 +0100
+++ b/src/node/ipv4-loopback-interface.cc	Mon Feb 12 19:52:01 2007 +0100
@@ -37,7 +37,9 @@
 
 Ipv4DummyNetDevice::Ipv4DummyNetDevice (Node *node)
   : NetDevice (node, MacAddress ())
-{}
+{
+  SetMtu (10000);
+}
 Node *
 Ipv4DummyNetDevice::PeekNode (void) const
 {