12 #include "../face.hpp"
17 : m_unixSocket(unixSocket)
31 return parsed.get<std::string>(
"unix_socket");
33 catch (boost::property_tree::ptree_bad_path& error)
37 catch (boost::property_tree::ptree_bad_data& error)
46 const std::string protocol = parsed.get<std::string>(
"protocol");
47 if (protocol ==
"ndnd-tlv-0.7")
49 return "/tmp/.ndnd.sock";
52 catch (boost::property_tree::ptree_bad_path& error)
54 return "/var/run/nfd.sock";
56 catch (boost::property_tree::ptree_bad_data& error)
64 return "/var/run/nfd.sock";
71 if (!static_cast<bool>(m_impl)) {
74 m_impl = make_shared<Impl> (boost::ref(*
this),
75 boost::ref(ioService));
78 m_impl->connect(boost::asio::local::stream_protocol::endpoint(m_unixSocket));
90 m_impl->send(header, payload);
virtual void connect(boost::asio::io_service &io_service, const ReceiveCallback &receiveCallback)
Connect transport.
ptr_lib::function< void(const Block &wire)> ReceiveCallback
static std::string getDefaultSocketName(const ConfigFile &config)
Determine the default NFD unix socket.
virtual void close()
Close the connection.
const Parsed & getParsedConfiguration() const
Class representing wire element of the NDN packet.
boost::property_tree::ptree Parsed
virtual void send(const Block &wire)
Set data to the host.
UnixTransport(const std::string &unixSocket)
Create Unix transport based on the socket specified in a well-known configuration file or fallback to...
virtual void connect(boost::asio::io_service &ioService, const ReceiveCallback &receiveCallback)
Connect transport.