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);
121 #endif // NDN_TRANSPORT_TRANSPORT_HPP
bool isReceiving() const noexcept
Error(const boost::system::error_code &code, const std::string &msg)
virtual void connect(boost::asio::io_service &ioService, ReceiveCallback receiveCallback)
Asynchronously open the connection.
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
std::function< void()> ErrorCallback
Common includes and macros used throughout the library.
virtual void resume()=0
resume the transport
boost::asio::io_service * m_ioService
bool isConnected() const noexcept
Provides TLV-block delivery service.
virtual void pause()=0
pause the transport
std::function< void(const Block &wire)> ReceiveCallback
virtual ~Transport()=default