NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
nfd::face::InternalClientTransport Class Reference

implements a client-side transport that can be paired with another More...

#include <internal-transport.hpp>

Inheritance diagram for nfd::face::InternalClientTransport:
Collaboration diagram for nfd::face::InternalClientTransport:

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, BlockafterSend
 
- 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
 

Detailed Description

implements a client-side transport that can be paired with another

Definition at line 81 of file internal-transport.hpp.

Member Function Documentation

§ connectToForwarder()

void nfd::face::InternalClientTransport::connectToForwarder ( InternalForwarderTransport forwarderTransport)

connect to a forwarder-side transport

Parameters
forwarderTransportthe 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.

§ receiveFromLink()

void nfd::face::InternalClientTransport::receiveFromLink ( const Block packet)
virtual

causes the transport to receive a link-layer packet

Implements nfd::face::InternalTransportBase.

Definition at line 115 of file internal-transport.cpp.

§ close()

virtual void nfd::face::InternalClientTransport::close ( )
inlinevirtual

Close the connection.

Implements ndn::Transport.

Definition at line 99 of file internal-transport.hpp.

§ pause()

virtual void nfd::face::InternalClientTransport::pause ( )
inlinevirtual

Implements ndn::Transport.

Definition at line 104 of file internal-transport.hpp.

§ resume()

virtual void nfd::face::InternalClientTransport::resume ( )
inlinevirtual

Implements ndn::Transport.

Definition at line 109 of file internal-transport.hpp.

References DECL_OVERRIDE, and NFD_LOG_INCLASS_DECLARE.

§ send() [1/2]

void nfd::face::InternalClientTransport::send ( const Block wire)
virtual

Send block of data from wire through the transport.

Parameters
wireA block of data to send

Implements ndn::Transport.

Definition at line 123 of file internal-transport.cpp.

References nfd::face::InternalTransportBase::afterSend, and emitSignal.

§ send() [2/2]

void nfd::face::InternalClientTransport::send ( const Block header,
const Block payload 
)
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().


The documentation for this class was generated from the following files: