7 #ifndef NDN_TRANSPORT_TRANSPORT_HPP
8 #define NDN_TRANSPORT_TRANSPORT_HPP
10 #include "../common.hpp"
11 #include "../encoding/block.hpp"
18 class Error :
public std::runtime_error
21 inline Error(
const boost::system::error_code& code,
const std::string& msg);
22 inline Error(
const std::string& msg);
40 connect(boost::asio::io_service& io_service,
93 , m_isConnected(false)
94 , m_isExpectingData(false)
100 : std::runtime_error(msg + (code.value() ?
" (" + code.category().message(code.value()) +
")" :
""))
106 : std::runtime_error(msg)
143 #endif // NDN_TRANSPORT_TRANSPORT_HPP
virtual void connect(boost::asio::io_service &io_service, const ReceiveCallback &receiveCallback)
Connect transport.
ptr_lib::function< void(const Block &wire)> ReceiveCallback
ptr_lib::function< void()> ErrorCallback
Error(const boost::system::error_code &code, const std::string &msg)
virtual void close()=0
Close the connection.
Class representing wire element of the NDN packet.
virtual void send(const Block &wire)=0
Set data to the host.
ReceiveCallback m_receiveCallback
boost::asio::io_service * m_ioService
void receive(const Block &wire)