NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
nfd::face::UdpChannel Class Referencefinal

Class implementing UDP-based channel to create faces. More...

#include <udp-channel.hpp>

Inheritance diagram for nfd::face::UdpChannel:
Collaboration diagram for nfd::face::UdpChannel:

Public Member Functions

 UdpChannel (const udp::Endpoint &localEndpoint, time::nanoseconds idleTimeout, bool wantCongestionMarking, size_t defaultMtu)
 Create a UDP channel on the given localEndpoint. More...
 
bool isListening () const final
 Returns whether the channel is listening. More...
 
size_t size () const final
 Returns the number of faces in the channel. More...
 
void connect (const udp::Endpoint &remoteEndpoint, const FaceParams &params, const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onConnectFailed)
 Create a unicast UDP face toward remoteEndpoint. More...
 
void listen (const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onFaceCreationFailed)
 Start listening. More...
 
- Public Member Functions inherited from nfd::face::Channel
virtual ~Channel ()
 
const FaceUrigetUri () const
 
size_t getDefaultMtu () const
 Returns the default MTU for all faces created by this channel. More...
 

Additional Inherited Members

- Protected Member Functions inherited from nfd::face::Channel
void setUri (const FaceUri &uri)
 
void setDefaultMtu (size_t mtu)
 

Detailed Description

Class implementing UDP-based channel to create faces.

Definition at line 40 of file udp-channel.hpp.

Constructor & Destructor Documentation

◆ UdpChannel()

nfd::face::UdpChannel::UdpChannel ( const udp::Endpoint localEndpoint,
time::nanoseconds  idleTimeout,
bool  wantCongestionMarking,
size_t  defaultMtu 
)

Create a UDP channel on the given localEndpoint.

To enable creation of faces upon incoming connections, one needs to explicitly call UdpChannel::listen method. The created socket is bound to localEndpoint.

Definition at line 39 of file udp-channel.cpp.

References NFD_LOG_CHAN_INFO, nfd::face::Channel::setDefaultMtu(), and nfd::face::Channel::setUri().

Member Function Documentation

◆ isListening()

bool nfd::face::UdpChannel::isListening ( ) const
inlinefinalvirtual

Returns whether the channel is listening.

Implements nfd::face::Channel.

Definition at line 56 of file udp-channel.hpp.

Referenced by listen().

◆ size()

size_t nfd::face::UdpChannel::size ( ) const
inlinefinalvirtual

Returns the number of faces in the channel.

Implements nfd::face::Channel.

Definition at line 62 of file udp-channel.hpp.

References connect(), listen(), and websocketpp::transport::asio::socket::error::socket.

◆ connect()

void nfd::face::UdpChannel::connect ( const udp::Endpoint remoteEndpoint,
const FaceParams params,
const FaceCreatedCallback onFaceCreated,
const FaceCreationFailedCallback onConnectFailed 
)

Create a unicast UDP face toward remoteEndpoint.

Definition at line 54 of file udp-channel.cpp.

References NFD_LOG_CHAN_DEBUG.

Referenced by size().

◆ listen()

void nfd::face::UdpChannel::listen ( const FaceCreatedCallback onFaceCreated,
const FaceCreationFailedCallback onFaceCreationFailed 
)

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