Provides TLV-block delivery service. More...
#include <transport.hpp>
Classes | |
class | Error |
Public Types | |
using | ReceiveCallback = std::function< void(const Block &wire)> |
using | ErrorCallback = std::function< void()> |
Public Member Functions | |
virtual | ~Transport ()=default |
virtual void | connect (ReceiveCallback receiveCallback) |
Asynchronously open the connection. More... | |
virtual void | close ()=0 |
Close the connection. More... | |
virtual void | send (const Block &block)=0 |
Send a TLV block through the transport. More... | |
virtual void | pause ()=0 |
Pause the transport, canceling all pending operations. More... | |
virtual void | resume ()=0 |
Resume the transport. More... | |
bool | isConnected () const noexcept |
Return whether the transport is connected. More... | |
bool | isReceiving () const noexcept |
Protected Attributes | |
ReceiveCallback | m_receiveCallback |
bool | m_isConnected = false |
bool | m_isReceiving = false |
Provides TLV-block delivery service.
Definition at line 35 of file transport.hpp.
using ndn::Transport::ReceiveCallback = std::function<void(const Block& wire)> |
Definition at line 46 of file transport.hpp.
using ndn::Transport::ErrorCallback = std::function<void()> |
Definition at line 47 of file transport.hpp.
|
virtualdefault |
|
virtual |
Asynchronously open the connection.
receiveCallback | callback function when a TLV block is received; must not be empty |
boost::system::system_error | connection cannot be established |
Definition at line 32 of file transport.cpp.
References m_receiveCallback, and nonstd::optional_lite::std11::move().
Referenced by ndn::util::DummyClientFace::~DummyClientFace().
|
pure virtual |
Close the connection.
Implemented in nfd::face::InternalClientTransport, and ndn::util::DummyClientFace::Transport.
|
pure virtual |
Send a TLV block through the transport.
Implemented in nfd::face::InternalClientTransport, and ndn::util::DummyClientFace::Transport.
|
pure virtual |
Pause the transport, canceling all pending operations.
Implemented in nfd::face::InternalClientTransport, and ndn::util::DummyClientFace::Transport.
|
pure virtual |
Resume the transport.
Implemented in nfd::face::InternalClientTransport, and ndn::util::DummyClientFace::Transport.
|
inlinenoexcept |
Return whether the transport is connected.
Definition at line 93 of file transport.hpp.
References m_isConnected.
|
inlinenoexcept |
true | incoming packets are expected, the receive callback will be invoked |
false | incoming packets are not expected, the receive callback will not be invoked |
Definition at line 103 of file transport.hpp.
References m_isReceiving.
|
protected |
Definition at line 109 of file transport.hpp.
Referenced by connect(), and ndn::util::DummyClientFace::Transport::receive().
|
protected |
Definition at line 110 of file transport.hpp.
Referenced by isConnected().
|
protected |
Definition at line 111 of file transport.hpp.
Referenced by isReceiving().