ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol > Class Template Reference

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

#include <stream-transport-with-resolver-impl.hpp>

+ Inheritance diagram for ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol >:
+ Collaboration diagram for ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol >:

Public Types

typedef std::list< BlockBlockSequence
 
using Impl = StreamTransportWithResolverImpl< BaseTransport, Protocol >
 
typedef std::list< BlockSequenceTransmissionQueue
 

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

Detailed Description

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

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

Definition at line 33 of file stream-transport-with-resolver-impl.hpp.

Member Typedef Documentation

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

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

template<typename BaseTransport , typename Protocol >
using ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol >::Impl = StreamTransportWithResolverImpl<BaseTransport,Protocol>

Definition at line 36 of file stream-transport-with-resolver-impl.hpp.

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

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

Constructor & Destructor Documentation

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

Definition at line 38 of file stream-transport-with-resolver-impl.hpp.

Member Function Documentation

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::asyncReceive ( )
inlineprotectedinherited

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

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::asyncWrite ( )
inlineprotectedinherited

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

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::close ( )
inlineinherited

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

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol >::connect ( const typename Protocol::resolver::query &  query)
inline
Todo:
Decide whether this number should be configurable

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

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::connect ( const typename Protocol::endpoint &  endpoint)
inlineinherited
Todo:
Decide whether this number should be configurable

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

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

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

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

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

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::handleAsyncReceive ( const boost::system::error_code &  error,
std::size_t  nBytesRecvd 
)
inlineprotectedinherited

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

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

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

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::pause ( )
inlineinherited

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

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

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

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol >::resolveHandler ( const boost::system::error_code &  error,
typename Protocol::resolver::iterator  endpoint,
const shared_ptr< typename Protocol::resolver > &   
)
inlineprotected

Definition at line 63 of file stream-transport-with-resolver-impl.hpp.

template<typename BaseTransport , typename Protocol >
void ndn::StreamTransportImpl< BaseTransport, Protocol >::resume ( )
inlineinherited

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

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

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

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

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

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

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

Member Data Documentation

template<typename BaseTransport , typename Protocol >
boost::asio::deadline_timer ndn::StreamTransportImpl< BaseTransport, Protocol >::m_connectTimer
protectedinherited

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

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

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

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

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

template<typename BaseTransport , typename Protocol >
bool ndn::StreamTransportImpl< BaseTransport, Protocol >::m_isConnecting
protectedinherited

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

template<typename BaseTransport , typename Protocol >
Protocol::socket ndn::StreamTransportImpl< BaseTransport, Protocol >::m_socket
protectedinherited

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

template<typename BaseTransport , typename Protocol >
TransmissionQueue ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transmissionQueue
protectedinherited

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

template<typename BaseTransport , typename Protocol >
BaseTransport& ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transport
protectedinherited

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