22 #ifndef NDN_TRANSPORT_TRANSPORT_HPP 23 #define NDN_TRANSPORT_TRANSPORT_HPP 29 #include <boost/system/error_code.hpp> 38 class Error :
public std::runtime_error
41 using std::runtime_error::runtime_error;
43 Error(
const boost::system::error_code& code,
const std::string& msg);
60 connect(boost::asio::io_service& ioService,
const ReceiveCallback& receiveCallback);
141 #endif // NDN_TRANSPORT_TRANSPORT_HPP
Error(const boost::system::error_code &code, const std::string &msg)
virtual void close()=0
Close the connection.
Represents a TLV element of NDN packet format.
virtual void send(const Block &wire)=0
send a TLV block through the transport
ReceiveCallback m_receiveCallback
function< void()> ErrorCallback
import common constructs for ndn-cxx library internal use
virtual void resume()=0
resume the transport
boost::asio::io_service * m_ioService
void receive(const Block &wire)
invoke the receive callback
provides TLV-block delivery service
virtual void pause()=0
pause the transport
virtual ~Transport()=default
function< void(const Block &wire)> ReceiveCallback
virtual void connect(boost::asio::io_service &ioService, const ReceiveCallback &receiveCallback)
asynchronously open the connection