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 &wire)=0 |
| send a TLV block through the transport More... | |
| virtual void | send (const Block &header, const Block &payload)=0 |
| send two memory blocks through the transport More... | |
| virtual void | pause ()=0 |
| pause the transport More... | |
| virtual void | resume ()=0 |
| resume the transport More... | |
| bool | isConnected () const noexcept |
| 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().
|
pure virtual |
Close the connection.
Implemented in ndn::util::DummyClientFace::Transport, and nfd::face::InternalClientTransport.
|
pure virtual |
send a TLV block through the transport
Implemented in ndn::util::DummyClientFace::Transport, and nfd::face::InternalClientTransport.
send two memory blocks through the transport
Scatter/gather API is utilized to send two non-consecutive memory blocks together (as part of the same message in datagram-oriented transports).
Implemented in ndn::util::DummyClientFace::Transport, and nfd::face::InternalClientTransport.
|
pure virtual |
pause the transport
Implemented in ndn::util::DummyClientFace::Transport, and nfd::face::InternalClientTransport.
|
pure virtual |
resume the transport
Implemented in ndn::util::DummyClientFace::Transport, and nfd::face::InternalClientTransport.
|
inlinenoexcept |
| true | connection has been established |
| false | connection is not yet established or has been closed |
Definition at line 97 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 106 of file transport.hpp.
References m_isReceiving.
|
protected |
Definition at line 112 of file transport.hpp.
Referenced by connect(), ndn::util::DummyClientFace::Transport::receive(), and nfd::face::InternalClientTransport::receivePacket().
|
protected |
Definition at line 113 of file transport.hpp.
Referenced by isConnected().
|
protected |
Definition at line 114 of file transport.hpp.
Referenced by isReceiving().