28 #include <boost/filesystem.hpp> 32 shared_ptr<UnixStreamChannel>
35 boost::filesystem::path p(unixSocketPath);
36 p = boost::filesystem::canonical(p.parent_path()) / p.filename();
39 auto channel = findChannel(endpoint);
43 channel = make_shared<UnixStreamChannel>(endpoint);
44 m_channels[endpoint] = channel;
54 BOOST_THROW_EXCEPTION(
Error(
"UnixStreamFactory does not support 'createFace' operation"));
57 std::vector<shared_ptr<const Channel>>
60 std::vector<shared_ptr<const Channel>> channels;
61 channels.reserve(m_channels.size());
63 for (
const auto& i : m_channels)
64 channels.push_back(i.second);
69 shared_ptr<UnixStreamChannel>
72 auto i = m_channels.find(endpoint);
73 if (i != m_channels.end())
function< void(const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when the face fails to be created.
represents the underlying protocol and address used by a Face
Exception of UnixStreamFactory.
Copyright (c) 2011-2015 Regents of the University of California.
shared_ptr< UnixStreamChannel > createChannel(const std::string &unixSocketPath)
Create stream-oriented Unix channel using specified socket path.
virtual std::vector< shared_ptr< const Channel > > getChannels() const 1
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
virtual void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onConnectFailed) 1
Try to create Face using the supplied FaceUri.