22 #ifndef NDN_CXX_TRANSPORT_TRANSPORT_HPP
23 #define NDN_CXX_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);
Represents a TLV element of the NDN packet format.
Error(const boost::system::error_code &code, const std::string &msg)
Provides TLV-block delivery service.
boost::asio::io_service * m_ioService
virtual void resume()=0
Resume the transport.
bool isConnected() const noexcept
Return whether the transport is connected.
virtual void send(const Block &block)=0
Send a TLV block through the transport.
virtual void connect(boost::asio::io_service &ioService, ReceiveCallback receiveCallback)
Asynchronously open the connection.
virtual ~Transport()=default
ReceiveCallback m_receiveCallback
bool isReceiving() const noexcept
virtual void close()=0
Close the connection.
std::function< void(const Block &wire)> ReceiveCallback
virtual void pause()=0
Pause the transport, canceling all pending operations.
std::function< void()> ErrorCallback
Common includes and macros used throughout the library.