26 #ifndef NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
27 #define NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
31 #include <boost/asio/local/stream_protocol.hpp>
34 using Endpoint = boost::asio::local::stream_protocol::endpoint;
51 class Error :
public std::runtime_error
54 using std::runtime_error::runtime_error;
70 return m_acceptor.is_open();
97 int backlog = boost::asio::local::stream_protocol::acceptor::max_connections);
105 handleAccept(
const boost::system::error_code& error,
111 boost::asio::local::stream_protocol::acceptor m_acceptor;
112 boost::asio::local::stream_protocol::socket m_socket;
114 bool m_wantCongestionMarking;
Represents a channel that listens on a local endpoint.
UnixStreamChannel-related error.
Class implementing a local channel to create faces.
size_t size() const final
Returns the number of faces in the channel.
bool isListening() const final
Returns whether the channel is listening.
UnixStreamChannel(const unix_stream::Endpoint &endpoint, bool wantCongestionMarking)
Create UnixStream channel for the specified endpoint.
void listen(const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onAcceptFailed, int backlog=boost::asio::local::stream_protocol::acceptor::max_connections)
Start listening.
~UnixStreamChannel() final
std::function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when a face fails to be created.
std::function< void(const shared_ptr< Face > &)> FaceCreatedCallback
Prototype for the callback that is invoked when a face is created (in response to an incoming connect...
boost::asio::local::stream_protocol::endpoint Endpoint