Implements a client-side transport that can be paired with an InternalForwarderTransport. More...
#include <internal-transport.hpp>
Public Member Functions | |
~InternalClientTransport () final | |
void | connectToForwarder (InternalForwarderTransport *forwarder) |
Connect to a forwarder-side transport. More... | |
void | receivePacket (const Block &packet) final |
void | send (const Block &block) final |
Send a TLV block through the transport. More... | |
void | close () final |
Close the connection. More... | |
void | pause () final |
Pause the transport, canceling all pending operations. More... | |
void | resume () final |
Resume the transport. More... | |
Public Member Functions inherited from ndn::Transport | |
virtual | ~Transport ()=default |
virtual void | connect (ReceiveCallback receiveCallback) |
Asynchronously open the connection. More... | |
bool | isConnected () const noexcept |
Return whether the transport is connected. More... | |
bool | isReceiving () const noexcept |
Public Member Functions inherited from nfd::face::InternalTransportBase | |
virtual | ~InternalTransportBase ()=default |
Additional Inherited Members | |
Public Types inherited from ndn::Transport | |
using | ReceiveCallback = std::function< void(const Block &wire)> |
using | ErrorCallback = std::function< void()> |
Protected Attributes inherited from ndn::Transport | |
ReceiveCallback | m_receiveCallback |
bool | m_isConnected = false |
bool | m_isReceiving = false |
Implements a client-side transport that can be paired with an InternalForwarderTransport.
Definition at line 84 of file internal-transport.hpp.
|
final |
Definition at line 74 of file internal-transport.cpp.
void nfd::face::InternalClientTransport::connectToForwarder | ( | InternalForwarderTransport * | forwarder | ) |
Connect to a forwarder-side transport.
forwarder | the forwarder-side transport to connect to; may be nullptr |
The connected forwarder-side transport will be disconnected automatically if this method is called again, or if that transport is closed. It's safe to use InternalClientTransport without a connected forwarder-side transport: all sent packets would be lost, and nothing would be received.
Definition at line 82 of file internal-transport.cpp.
References nfd::face::CLOSED, NFD_LOG_DEBUG, and nfd::face::InternalForwarderTransport::setPeer().
|
finalvirtual |
Implements nfd::face::InternalTransportBase.
Definition at line 107 of file internal-transport.cpp.
References nfd::getGlobalIoService(), NFD_LOG_TRACE, nfd::detail::SimulatorIo::post(), and ndn::Block::size().
|
finalvirtual |
Send a TLV block through the transport.
Implements ndn::Transport.
Definition at line 118 of file internal-transport.cpp.
References NFD_LOG_TRACE.
|
inlinefinalvirtual |
Close the connection.
Implements ndn::Transport.
Definition at line 107 of file internal-transport.hpp.
|
inlinefinalvirtual |
Pause the transport, canceling all pending operations.
Implements ndn::Transport.
Definition at line 112 of file internal-transport.hpp.
|
inlinefinalvirtual |
Resume the transport.
Implements ndn::Transport.
Definition at line 117 of file internal-transport.hpp.
References NFD_LOG_MEMBER_DECL.