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;
49 struct Error :
public std::runtime_error
51 Error(
const std::string& what) :
std::runtime_error(what) {}
77 int backlog = boost::asio::local::stream_protocol::acceptor::max_connections);
88 handleAccept(
const boost::system::error_code& error,
94 boost::asio::local::stream_protocol::acceptor m_acceptor;
95 boost::asio::local::stream_protocol::socket m_socket;
101 return m_acceptor.is_open();
106 #endif // NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
Error(const std::string &what)
UnixStreamChannel-related error.
represent a channel that communicates on a local endpoint
~UnixStreamChannel() override
UnixStreamChannel(const unix_stream::Endpoint &endpoint)
Create UnixStream channel for the specified endpoint.
Class implementing a local channel to create faces.
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 mad...
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when the face fails to be created.
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback that is invoked when the face is created (as a response to incoming connec...
boost::asio::local::stream_protocol::endpoint Endpoint