Class implementing a local channel to create faces. More...
#include <unix-stream-channel.hpp>
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 () override | |
void | listen (const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &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 FaceUri & | getUri () const |
Additional Inherited Members | |
Protected Member Functions inherited from nfd::Channel | |
void | setUri (const FaceUri &uri) |
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 43 of file unix-stream-channel.hpp.
|
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 38 of file unix-stream-channel.cpp.
References nfd::Channel::setUri().
|
override |
Definition at line 46 of file unix-stream-channel.cpp.
References isListening(), and NFD_LOG_DEBUG.
void nfd::UnixStreamChannel::listen | ( | const FaceCreatedCallback & | onFaceCreated, |
const FaceCreationFailedCallback & | 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.
onFaceCreated | Callback to notify successful creation of the face |
onAcceptFailed | Callback to notify when channel fails (accept call returns an error) |
backlog | The maximum length of the queue of pending incoming connections |
Definition at line 59 of file unix-stream-channel.cpp.
References nfd::getGlobalIoService(), isListening(), NFD_LOG_DEBUG, NFD_LOG_TRACE, and NFD_LOG_WARN.
|
inline |
Definition at line 99 of file unix-stream-channel.hpp.
Referenced by listen(), and ~UnixStreamChannel().