#include "ns3/core-module.h"
#include "ns3/internet-module.h"
#include "ns3/network-module.h"
#include <iostream>
Go to the source code of this file.
Functions | |
static void | GenerateTraffic (Ptr< Socket > socket, int32_t size) |
Generates traffic. | |
static void | SocketPrinter (Ptr< Socket > socket) |
Prints the packets received by a socket. | |
Generates traffic.
The first call sends a packet of the specified size, and then the function is scheduled to send a packet of (size-50) after 0.5s. The process is iterated until the packet size is zero.
socket | output socket |
size | packet size |
Definition at line 28 of file main-simple.cc.
References ns3::Create(), GenerateTraffic(), ns3::Time::GetSeconds(), ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Seconds().
Referenced by GenerateTraffic().
Prints the packets received by a socket.
socket | input socket |
Definition at line 46 of file main-simple.cc.
References ns3::Time::GetSeconds(), and ns3::Simulator::Now().