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);
147 #endif // NDN_TRANSPORT_TRANSPORT_HPP
Copyright (c) 2013-2016 Regents of the University of California.
Copyright (c) 2013-2016 Regents of the University of California.
Error(const boost::system::error_code &code, const std::string &msg)
virtual void close()=0
Close the connection.
Class representing a wire element of NDN-TLV packet format.
virtual void send(const Block &wire)=0
send a TLV block through the transport
ReceiveCallback m_receiveCallback
function< void()> ErrorCallback
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