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

Implements a client-side transport that can be paired with an InternalForwarderTransport. More...

#include <internal-transport.hpp>

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

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
 

Detailed Description

Implements a client-side transport that can be paired with an InternalForwarderTransport.

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

Constructor & Destructor Documentation

◆ ~InternalClientTransport()

nfd::face::InternalClientTransport::~InternalClientTransport ( )
final

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

Member Function Documentation

◆ connectToForwarder()

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

Connect to a forwarder-side transport.

Parameters
forwarderthe 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().

◆ receivePacket()

void nfd::face::InternalClientTransport::receivePacket ( const Block packet)
finalvirtual

◆ send()

void nfd::face::InternalClientTransport::send ( const Block block)
finalvirtual

Send a TLV block through the transport.

Implements ndn::Transport.

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

References NFD_LOG_TRACE.

◆ close()

void nfd::face::InternalClientTransport::close ( )
inlinefinalvirtual

Close the connection.

Implements ndn::Transport.

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

◆ pause()

void nfd::face::InternalClientTransport::pause ( )
inlinefinalvirtual

Pause the transport, canceling all pending operations.

Postcondition
the receive callback will not be invoked
Note
This operation has no effect if the transport has been paused, or when the connection is being established.

Implements ndn::Transport.

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

◆ resume()

void nfd::face::InternalClientTransport::resume ( )
inlinefinalvirtual

Resume the transport.

Postcondition
the receive callback will be invoked
Note
This operation has no effect if the transport is not paused, or when the connection is being established.

Implements ndn::Transport.

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

References NFD_LOG_MEMBER_DECL.


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