26 #ifndef NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
27 #define NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
33 namespace unix_stream {
34 typedef boost::asio::local::stream_protocol::endpoint
Endpoint;
51 class Error :
public std::runtime_error
56 : std::runtime_error(what)
74 return m_acceptor.is_open();
101 int backlog = boost::asio::local::stream_protocol::acceptor::max_connections);
109 handleAccept(
const boost::system::error_code& error,
115 boost::asio::local::stream_protocol::acceptor m_acceptor;
116 boost::asio::local::stream_protocol::socket m_socket;
118 bool m_wantCongestionMarking;
Represents a channel that listens on a local endpoint.
UnixStreamChannel-related error.
Error(const std::string &what)
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
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents,...