Class implementing a local channel to create faces. More...
#include <daemon/face/unix-stream-channel.hpp>
Classes | |
class | Error |
UnixStreamChannel-related error. More... | |
Public Member Functions | |
UnixStreamChannel (const unix_stream::Endpoint &endpoint) | |
Create UnixStream channel for the specified endpoint. More... | |
~UnixStreamChannel () override | |
const FaceUri & | getUri () const |
bool | isListening () const override |
Returns whether the channel is listening. More... | |
void | listen (const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onAcceptFailed, int backlog=boost::asio::local::stream_protocol::acceptor::max_connections) |
Start listening. More... | |
size_t | size () const override |
Returns the number of faces in the channel. More... | |
Protected Member Functions | |
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 45 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 39 of file unix-stream-channel.cpp.
|
override |
Definition at line 49 of file unix-stream-channel.cpp.
|
inlineinherited |
Definition at line 59 of file channel.hpp.
|
inlineoverridevirtual |
Returns whether the channel is listening.
Implements nfd::face::Channel.
Definition at line 73 of file unix-stream-channel.hpp.
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.
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 |
Error |
Definition at line 62 of file unix-stream-channel.cpp.
|
protectedinherited |
Definition at line 34 of file channel.cpp.
|
inlineoverridevirtual |
Returns the number of faces in the channel.
Implements nfd::face::Channel.
Definition at line 79 of file unix-stream-channel.hpp.