NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: 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 38 of file stream-transport-impl.hpp.

Member Typedef Documentation

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

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

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

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

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

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

Constructor & Destructor Documentation

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

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

Member Function Documentation

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::send ( const Block wire)
inline
template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::send ( const Block header,
const Block payload 
)
inline
template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::connectTimeoutHandler ( const boost::system::error_code &  error)
inlineprotected
template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::send ( BlockSequence &&  sequence)
inlineprotected
template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::handleAsyncWrite ( const boost::system::error_code &  error,
TransmissionQueue::iterator  queueItem 
)
inlineprotected
template<typename BaseTransport , typename Protocol >
bool ndn::StreamTransportImpl< BaseTransport, Protocol >::processAllReceived ( uint8_t *  buffer,
size_t &  offset,
size_t  nBytesAvailable 
)
inlineprotected

Member Data Documentation

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

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