NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::StreamTransportImpl< BaseTransport, Protocol > Class Template Reference

implementation detail of a Boost.Asio-based stream-oriented transport More...

#include <stream-transport-impl.hpp>

Inheritance diagram for ndn::StreamTransportImpl< BaseTransport, Protocol >:
Collaboration diagram for ndn::StreamTransportImpl< BaseTransport, Protocol >:

Public Types

typedef StreamTransportImpl< BaseTransport, Protocol > Impl
 
typedef std::list< BlockBlockSequence
 
typedef std::list< BlockSequenceTransmissionQueue
 

Public Member Functions

 StreamTransportImpl (BaseTransport &transport, boost::asio::io_service &ioService)
 
void connect (const typename Protocol::endpoint &endpoint)
 
void close ()
 
void pause ()
 
void resume ()
 
void send (const Block &wire)
 
void send (const Block &header, const Block &payload)
 

Protected Member Functions

void connectHandler (const boost::system::error_code &error)
 
void connectTimeoutHandler (const boost::system::error_code &error)
 
void send (BlockSequence &&sequence)
 
void asyncWrite ()
 
void handleAsyncWrite (const boost::system::error_code &error, TransmissionQueue::iterator queueItem)
 
void asyncReceive ()
 
void handleAsyncReceive (const boost::system::error_code &error, std::size_t nBytesRecvd)
 
bool processAllReceived (uint8_t *buffer, size_t &offset, size_t nBytesAvailable)
 

Protected Attributes

BaseTransport & m_transport
 
Protocol::socket m_socket
 
uint8_t m_inputBuffer [MAX_NDN_PACKET_SIZE]
 
size_t m_inputBufferSize
 
TransmissionQueue m_transmissionQueue
 
bool m_isConnecting
 
boost::asio::deadline_timer m_connectTimer
 

Detailed Description

template<typename BaseTransport, typename Protocol>
class ndn::StreamTransportImpl< BaseTransport, Protocol >

implementation detail of a Boost.Asio-based stream-oriented transport

Template Parameters
BaseTransporta subclass of Transport
Protocola Boost.Asio stream-oriented protocol, including boost::asio::ip::tcp and boost::asio::local::stream_protocol

Definition at line 40 of file stream-transport-impl.hpp.

Member Typedef Documentation

◆ Impl

template<typename BaseTransport , typename Protocol >
typedef StreamTransportImpl<BaseTransport, Protocol> ndn::StreamTransportImpl< BaseTransport, Protocol >::Impl

Definition at line 43 of file stream-transport-impl.hpp.

◆ BlockSequence

template<typename BaseTransport , typename Protocol >
typedef std::list<Block> ndn::StreamTransportImpl< BaseTransport, Protocol >::BlockSequence

Definition at line 44 of file stream-transport-impl.hpp.

◆ TransmissionQueue

template<typename BaseTransport , typename Protocol >
typedef std::list<BlockSequence> ndn::StreamTransportImpl< BaseTransport, Protocol >::TransmissionQueue

Definition at line 45 of file stream-transport-impl.hpp.

Constructor & Destructor Documentation

◆ StreamTransportImpl()

template<typename BaseTransport , typename Protocol >
ndn::StreamTransportImpl< BaseTransport, Protocol >::StreamTransportImpl ( BaseTransport &  transport,
boost::asio::io_service &  ioService 
)
inline

Definition at line 47 of file stream-transport-impl.hpp.

Member Function Documentation

◆ connect()

◆ close()

◆ pause()

◆ resume()

◆ send() [1/3]

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::send ( const Block wire)
inline

◆ send() [2/3]

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::send ( const Block header,
const Block payload 
)
inline

◆ connectHandler()

◆ connectTimeoutHandler()

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::connectTimeoutHandler ( const boost::system::error_code &  error)
inlineprotected

◆ send() [3/3]

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::send ( BlockSequence &&  sequence)
inlineprotected

◆ asyncWrite()

◆ handleAsyncWrite()

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::handleAsyncWrite ( const boost::system::error_code &  error,
TransmissionQueue::iterator  queueItem 
)
inlineprotected

◆ asyncReceive()

◆ handleAsyncReceive()

◆ processAllReceived()

template<typename BaseTransport , typename Protocol >
bool ndn::StreamTransportImpl< BaseTransport, Protocol >::processAllReceived ( uint8_t *  buffer,
size_t &  offset,
size_t  nBytesAvailable 
)
inlineprotected

Member Data Documentation

◆ m_transport

◆ m_socket

◆ m_inputBuffer

template<typename BaseTransport , typename Protocol >
uint8_t ndn::StreamTransportImpl< BaseTransport, Protocol >::m_inputBuffer[MAX_NDN_PACKET_SIZE]
protected

◆ m_inputBufferSize

template<typename BaseTransport , typename Protocol >
size_t ndn::StreamTransportImpl< BaseTransport, Protocol >::m_inputBufferSize
protected

◆ m_transmissionQueue

◆ m_isConnecting

◆ m_connectTimer


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