implements a client-side transport that can be paired with another More...
#include <internal-transport.hpp>
Public Member Functions | |
void | connectToForwarder (InternalForwarderTransport *forwarderTransport) |
connect to a forwarder-side transport More... | |
virtual void | receiveFromLink (const Block &packet) 1 |
causes the transport to receive a link-layer packet More... | |
virtual void | close () 1 |
Close the connection. More... | |
virtual void | pause () 1 |
virtual void | resume () 1 |
virtual void | send (const Block &wire) 1 |
Send block of data from wire through the transport. More... | |
virtual void | send (const Block &header, const Block &payload) 1 |
Alternative version of sending data, applying scatter/gather I/O concept. More... | |
Public Member Functions inherited from ndn::Transport | |
Transport () | |
virtual | ~Transport () |
virtual void | connect (boost::asio::io_service &io_service, const ReceiveCallback &receiveCallback) |
Connect transport. More... | |
bool | isConnected () |
bool | isExpectingData () |
Additional Inherited Members | |
Public Types inherited from ndn::Transport | |
typedef function< void(const Block &wire)> | ReceiveCallback |
typedef function< void()> | ErrorCallback |
Public Attributes inherited from nfd::face::InternalTransportBase | |
signal::Signal< InternalTransportBase, Block > | afterSend |
Protected Member Functions inherited from ndn::Transport | |
void | receive (const Block &wire) |
Protected Attributes inherited from ndn::Transport | |
boost::asio::io_service * | m_ioService |
bool | m_isConnected |
bool | m_isExpectingData |
ReceiveCallback | m_receiveCallback |
implements a client-side transport that can be paired with another
Definition at line 81 of file internal-transport.hpp.
void nfd::face::InternalClientTransport::connectToForwarder | ( | InternalForwarderTransport * | forwarderTransport | ) |
connect to a forwarder-side transport
forwarderTransport | 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 94 of file internal-transport.cpp.
References nfd::face::InternalTransportBase::afterSend, nfd::face::Transport::afterStateChange, nfd::face::asyncReceive(), nfd::face::CLOSED, and NFD_LOG_DEBUG.
|
virtual |
causes the transport to receive a link-layer packet
Implements nfd::face::InternalTransportBase.
Definition at line 115 of file internal-transport.cpp.
|
inlinevirtual |
Close the connection.
Implements ndn::Transport.
Definition at line 99 of file internal-transport.hpp.
|
inlinevirtual |
Implements ndn::Transport.
Definition at line 104 of file internal-transport.hpp.
|
inlinevirtual |
Implements ndn::Transport.
Definition at line 109 of file internal-transport.hpp.
References DECL_OVERRIDE, and NFD_LOG_INCLASS_DECLARE.
|
virtual |
Send block of data from wire
through the transport.
wire | A block of data to send |
Implements ndn::Transport.
Definition at line 123 of file internal-transport.cpp.
References nfd::face::InternalTransportBase::afterSend, and emitSignal.
|
virtual |
Alternative version of sending data, applying scatter/gather I/O concept.
Two non-consecutive memory blocks will be send out together, e.g., as part of the same message in datagram-oriented transports.
Implements ndn::Transport.
Definition at line 129 of file internal-transport.cpp.
References ndn::encoding::Encoder::appendByteArray(), nfd::face::Transport::send(), ndn::Block::size(), and ndn::Block::wire().