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
 
bool m_isConnecting = false
 
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 189 of file stream-transport-impl.hpp.

◆ asyncWrite()

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

Definition at line 160 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 130 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 150 of file stream-transport-impl.hpp.

◆ pause()

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

Definition at line 92 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 229 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 104 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 117 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 251 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 248 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 249 of file stream-transport-impl.hpp.

◆ m_isConnecting

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

Definition at line 252 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 247 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 250 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 245 of file stream-transport-impl.hpp.