Class implementing a local channel to create faces. More...
#include <daemon/face/unix-stream-channel.hpp>
Public Member Functions | |
UnixStreamChannel (const unix_stream::Endpoint &endpoint, bool wantCongestionMarking) | |
Create a UnixStream channel for the specified endpoint . More... | |
~UnixStreamChannel () final | |
size_t | getDefaultMtu () const noexcept |
Returns the default MTU for all faces created by this channel. More... | |
const FaceUri & | getUri () const noexcept |
bool | isListening () const final |
Returns whether the channel is listening. More... | |
void | listen (const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onAcceptFailed, int backlog=boost::asio::socket_base::max_listen_connections) |
Start listening. More... | |
size_t | size () const final |
Returns the number of faces in the channel. More... | |
Protected Member Functions | |
void | setDefaultMtu (size_t mtu) noexcept |
void | setUri (const FaceUri &uri) noexcept |
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.
nfd::face::UnixStreamChannel::UnixStreamChannel | ( | const unix_stream::Endpoint & | endpoint, |
bool | wantCongestionMarking | ||
) |
Create a UnixStream channel for the specified endpoint
.
To enable the creation of faces upon incoming connections, one needs to explicitly call listen().
Definition at line 40 of file unix-stream-channel.cpp.
|
final |
Definition at line 50 of file unix-stream-channel.cpp.
|
inlinenoexceptinherited |
Returns the default MTU for all faces created by this channel.
Definition at line 58 of file channel.hpp.
|
inlinenoexceptinherited |
Definition at line 49 of file channel.hpp.
|
inlinefinalvirtual |
Returns whether the channel is listening.
Implements nfd::face::Channel.
Definition at line 59 of file unix-stream-channel.hpp.
void nfd::face::UnixStreamChannel::listen | ( | const FaceCreatedCallback & | onFaceCreated, |
const FaceCreationFailedCallback & | onAcceptFailed, | ||
int | backlog = boost::asio::socket_base::max_listen_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 |
boost::system::system_error |
Definition at line 62 of file unix-stream-channel.cpp.
|
protectednoexceptinherited |
Definition at line 40 of file channel.cpp.
|
protectednoexceptinherited |
Definition at line 34 of file channel.cpp.
|
inlinefinalvirtual |
Returns the number of faces in the channel.
Implements nfd::face::Channel.
Definition at line 65 of file unix-stream-channel.hpp.