A Discrete-Event Network Simulator
API
ns3::UdpServerHelper Class Reference

Create a server application which waits for input UDP packets and uses the information carried into their payload to compute delay and to determine if some packets are lost. More...

#include "udp-client-server-helper.h"

+ Collaboration diagram for ns3::UdpServerHelper:

Public Member Functions

 UdpServerHelper ()
 Create UdpServerHelper which will make life easier for people trying to set up simulations with udp-client-server application. More...
 
 UdpServerHelper (uint16_t port)
 Create UdpServerHelper which will make life easier for people trying to set up simulations with udp-client-server application. More...
 
Ptr< UdpServerGetServer ()
 Return the last created server. More...
 
ApplicationContainer Install (NodeContainer c)
 Create one UDP server application on each of the Nodes in the NodeContainer. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Record an attribute to be set in each Application after it is is created. More...
 

Private Attributes

ObjectFactory m_factory
 Object factory. More...
 
Ptr< UdpServerm_server
 The last created server application. More...
 

Detailed Description

Create a server application which waits for input UDP packets and uses the information carried into their payload to compute delay and to determine if some packets are lost.

Definition at line 39 of file udp-client-server-helper.h.

Constructor & Destructor Documentation

◆ UdpServerHelper() [1/2]

ns3::UdpServerHelper::UdpServerHelper ( )

Create UdpServerHelper which will make life easier for people trying to set up simulations with udp-client-server application.

Definition at line 30 of file udp-client-server-helper.cc.

References ns3::UdpServer::GetTypeId(), m_factory, and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ UdpServerHelper() [2/2]

ns3::UdpServerHelper::UdpServerHelper ( uint16_t  port)

Create UdpServerHelper which will make life easier for people trying to set up simulations with udp-client-server application.

Parameters
portThe port the server will wait on for incoming packets

Definition at line 35 of file udp-client-server-helper.cc.

References ns3::UdpServer::GetTypeId(), m_factory, port, SetAttribute(), and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

Member Function Documentation

◆ GetServer()

Ptr< UdpServer > ns3::UdpServerHelper::GetServer ( )

Return the last created server.

This function is mainly used for testing.

Returns
a Ptr to the last created server application

Definition at line 63 of file udp-client-server-helper.cc.

References m_server.

◆ Install()

ApplicationContainer ns3::UdpServerHelper::Install ( NodeContainer  c)

Create one UDP server application on each of the Nodes in the NodeContainer.

Parameters
cThe nodes on which to create the Applications. The nodes are specified by a NodeContainer.
Returns
The applications created, one Application per Node in the NodeContainer.

Definition at line 48 of file udp-client-server-helper.cc.

References ns3::ApplicationContainer::Add(), ns3::Node::AddApplication(), ns3::NodeContainer::Begin(), ns3::ObjectFactory::Create(), ns3::NodeContainer::End(), m_factory, and m_server.

+ Here is the call graph for this function:

◆ SetAttribute()

void ns3::UdpServerHelper::SetAttribute ( std::string  name,
const AttributeValue value 
)

Record an attribute to be set in each Application after it is is created.

Parameters
namethe name of the attribute to set
valuethe value of the attribute to set

Definition at line 42 of file udp-client-server-helper.cc.

References m_factory, and ns3::ObjectFactory::Set().

Referenced by UdpServerHelper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_factory

ObjectFactory ns3::UdpServerHelper::m_factory
private

Object factory.

Definition at line 86 of file udp-client-server-helper.h.

Referenced by UdpServerHelper(), Install(), and SetAttribute().

◆ m_server

Ptr<UdpServer> ns3::UdpServerHelper::m_server
private

The last created server application.

Definition at line 87 of file udp-client-server-helper.h.

Referenced by GetServer(), and Install().


The documentation for this class was generated from the following files: