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

Class implementing a local channel to create faces. More...

#include <unix-stream-channel.hpp>

Inheritance diagram for nfd::face::UnixStreamChannel:
Collaboration diagram for nfd::face::UnixStreamChannel:


class  Error
 UnixStreamChannel-related error. More...

Public Member Functions

 UnixStreamChannel (const unix_stream::Endpoint &endpoint, bool wantCongestionMarking)
 Create UnixStream channel for the specified endpoint. More...
 ~UnixStreamChannel () final
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 listen (const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onAcceptFailed, int backlog=boost::asio::local::stream_protocol::acceptor::max_connections)
 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 a local channel to create faces.

Channel can create faces as a response to incoming IPC connections (UnixStreamChannel::listen needs to be called for that to work).

Definition at line 45 of file unix-stream-channel.hpp.

Constructor & Destructor Documentation

◆ UnixStreamChannel()

nfd::face::UnixStreamChannel::UnixStreamChannel ( const unix_stream::Endpoint endpoint,
bool  wantCongestionMarking 

Create UnixStream channel for the specified endpoint.

To enable creation of faces upon incoming connections, one needs to explicitly call UnixStreamChannel::listen method.

Definition at line 40 of file unix-stream-channel.cpp.

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

◆ ~UnixStreamChannel()

nfd::face::UnixStreamChannel::~UnixStreamChannel ( )

Definition at line 52 of file unix-stream-channel.cpp.

References isListening(), and NFD_LOG_CHAN_DEBUG.

Member Function Documentation

◆ isListening()

bool nfd::face::UnixStreamChannel::isListening ( ) const

Returns whether the channel is listening.

Implements nfd::face::Channel.

Definition at line 72 of file unix-stream-channel.hpp.

Referenced by listen(), and ~UnixStreamChannel().

◆ size()

size_t nfd::face::UnixStreamChannel::size ( ) const

Returns the number of faces in the channel.

Implements nfd::face::Channel.

Definition at line 78 of file unix-stream-channel.hpp.

References websocketpp::extensions::permessage_deflate::mode::accept, and websocketpp::transport::asio::socket::error::socket.

◆ listen()

void nfd::face::UnixStreamChannel::listen ( const FaceCreatedCallback onFaceCreated,
const FaceCreationFailedCallback onAcceptFailed,
int  backlog = boost::asio::local::stream_protocol::acceptor::max_connections 

Start listening.

Enable listening on the Unix socket, waiting for incoming connections, and creating a face when a connection is made.

Faces created in this way will have on-demand persistency.

onFaceCreatedCallback to notify successful creation of the face
onAcceptFailedCallback to notify when channel fails (accept call returns an error)
backlogThe maximum length of the queue of pending incoming connections

Definition at line 65 of file unix-stream-channel.cpp.

References websocketpp::extensions::permessage_deflate::mode::accept, nfd::face::connectFaceClosedSignal(), nfd::getGlobalIoService(), isListening(), nonstd::optional_lite::std11::move(), NDN_THROW, NDN_THROW_ERRNO, NFD_LOG_CHAN_DEBUG, NFD_LOG_CHAN_TRACE, NFD_LOG_CHAN_WARN, websocketpp::transport::error::operation_aborted, and websocketpp::transport::asio::socket::error::socket.

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