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

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

#include <unix-stream-channel.hpp>

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

Classes

struct  Error
 UnixStreamChannel-related error. More...
 

Public Member Functions

 UnixStreamChannel (const unix_stream::Endpoint &endpoint)
 Create UnixStream channel for the specified endpoint. More...
 
 ~UnixStreamChannel () 1
 
void listen (const FaceCreatedCallback &onFaceCreated, const ConnectFailedCallback &onAcceptFailed, int backlog=boost::asio::local::stream_protocol::acceptor::max_connections)
 Enable listening on the local endpoint, accept connections, and create faces when a connection is made. More...
 
bool isListening () const
 
- Public Member Functions inherited from nfd::Channel
virtual ~Channel ()
 
const FaceUrigetUri () const
 

Additional Inherited Members

- Public Types inherited from nfd::Channel
typedef function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
 Prototype for the callback called when face is created (as a response to incoming connection or after connection is established) More...
 
typedef function< void(const std::string &reason)> ConnectFailedCallback
 Prototype for the callback that is called when face is failed to get created. More...
 
- Protected Member Functions inherited from nfd::Channel
void setUri (const FaceUri &uri)
 

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 42 of file unix-stream-channel.hpp.

Constructor & Destructor Documentation

nfd::UnixStreamChannel::UnixStreamChannel ( const unix_stream::Endpoint endpoint)
explicit

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 37 of file unix-stream-channel.cpp.

References nfd::Channel::setUri().

nfd::UnixStreamChannel::~UnixStreamChannel ( )

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

References isListening(), and NFD_LOG_DEBUG.

Member Function Documentation

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

Enable listening on the local endpoint, accept connections, and create faces when a connection is made.

Parameters
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 58 of file unix-stream-channel.cpp.

References ndn::util::FaceUri::fromFd(), nfd::getGlobalIoService(), isListening(), NFD_LOG_DEBUG, NFD_LOG_TRACE, and NFD_LOG_WARN.

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

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

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


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