22 #ifndef NDN_TRANSPORT_TRANSPORT_HPP 23 #define NDN_TRANSPORT_TRANSPORT_HPP 25 #include "../common.hpp" 26 #include "../encoding/block.hpp" 28 #include <boost/system/error_code.hpp> 43 class Error :
public std::runtime_error
46 Error(
const boost::system::error_code& code,
const std::string& msg);
49 Error(
const std::string& msg);
66 connect(boost::asio::io_service& ioService,
const ReceiveCallback& receiveCallback);
76 send(
const Block& wire) = 0;
84 send(
const Block& header,
const Block& payload) = 0;
118 receive(
const Block& wire);
128 Transport::isConnected()
const 130 return m_isConnected;
134 Transport::isReceiving()
const 136 return m_isReceiving;
140 Transport::receive(
const Block& wire)
142 m_receiveCallback(wire);
147 #endif // NDN_TRANSPORT_TRANSPORT_HPP
Copyright (c) 2013-2017 Regents of the University of California.
Copyright (c) 2013-2017 Regents of the University of California.
Represents a TLV element of NDN packet format.
ReceiveCallback m_receiveCallback
function< void()> ErrorCallback
boost::asio::io_service * m_ioService
provides TLV-block delivery service
function< void(const Block &wire)> ReceiveCallback