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

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

#include <ndn-cxx/transport/detail/stream-transport-with-resolver-impl.hpp>

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

Public Types

using TransmissionQueue = std::queue< Block, std::list< Block > >
 

Public Member Functions

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

Protected Member Functions

void asyncReceive ()
 
void asyncWrite ()
 
void connectHandler (const boost::system::error_code &error)
 
void connectTimeoutHandler (const boost::system::error_code &error)
 
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 > &)
 

Protected Attributes

boost::asio::steady_timer m_connectTimer
 
uint8_t m_inputBuffer [MAX_NDN_PACKET_SIZE]
 
size_t m_inputBufferSize = 0
 
Protocol::socket m_socket
 
TransmissionQueue m_transmissionQueue
 
BaseTransport & m_transport
 

Detailed Description

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

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

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

Member Typedef Documentation

◆ TransmissionQueue

template<typename BaseTransport , typename Protocol >
using ndn::detail::StreamTransportImpl< BaseTransport, Protocol >::TransmissionQueue = std::queue<Block, std::list<Block> >
inherited

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

Constructor & Destructor Documentation

◆ StreamTransportWithResolverImpl()

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

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

Member Function Documentation

◆ asyncReceive()

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

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

◆ asyncWrite()

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

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

◆ close()

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

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

◆ connect() [1/2]

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

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

◆ connect() [2/2]

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

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

◆ connectHandler()

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

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

◆ connectTimeoutHandler()

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

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

◆ pause()

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

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

◆ processAllReceived()

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

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

◆ resolveHandler()

template<typename BaseTransport , typename Protocol >
void ndn::detail::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 71 of file stream-transport-with-resolver-impl.hpp.

◆ resume()

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

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

◆ send()

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

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

Member Data Documentation

◆ m_connectTimer

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

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

◆ m_inputBuffer

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

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

◆ m_inputBufferSize

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

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

◆ m_socket

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

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

◆ m_transmissionQueue

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

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

◆ m_transport

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

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