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 Member Functions

 StreamTransportWithResolverImpl (BaseTransport &transport, boost::asio::io_context &ioCtx)
 
void close ()
 
void connect (const typename Protocol::endpoint &endpoint)
 
void connect (std::string_view host, std::string_view port)
 
void pause ()
 
void resume ()
 
void send (const Block &block)
 

Protected Types

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

Protected Member Functions

void asyncReceive ()
 
void asyncWrite ()
 
void connectHandler (const boost::system::error_code &error)
 
void resolveHandler (const std::string &hostAndPort, const boost::system::error_code &error, const typename Protocol::resolver::results_type &endpoints)
 

Protected Attributes

boost::asio::steady_timer m_connectTimer
 
Protocol::endpoint m_endpoint
 
std::array< uint8_t, MAX_NDN_PACKET_SIZEm_rxBuffer
 
size_t m_rxBufferSize = 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> >
protectedinherited

Definition at line 47 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_context &  ioCtx 
)
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 185 of file stream-transport-impl.hpp.

◆ asyncWrite()

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

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

◆ close()

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

Definition at line 86 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 58 of file stream-transport-impl.hpp.

◆ connect() [2/2]

template<typename BaseTransport , typename Protocol >
void ndn::detail::StreamTransportWithResolverImpl< BaseTransport, Protocol >::connect ( std::string_view  host,
std::string_view  port 
)
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 133 of file stream-transport-impl.hpp.

◆ pause()

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

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

◆ resolveHandler()

template<typename BaseTransport , typename Protocol >
void ndn::detail::StreamTransportWithResolverImpl< BaseTransport, Protocol >::resolveHandler ( const std::string &  hostAndPort,
const boost::system::error_code &  error,
const typename Protocol::resolver::results_type &  endpoints 
)
inlineprotected

Definition at line 73 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 108 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 118 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 233 of file stream-transport-impl.hpp.

◆ m_endpoint

template<typename BaseTransport , typename Protocol >
Protocol::endpoint ndn::detail::StreamTransportImpl< BaseTransport, Protocol >::m_endpoint
protectedinherited

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

◆ m_rxBuffer

template<typename BaseTransport , typename Protocol >
std::array<uint8_t, MAX_NDN_PACKET_SIZE> ndn::detail::StreamTransportImpl< BaseTransport, Protocol >::m_rxBuffer
protectedinherited

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

◆ m_rxBufferSize

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

Definition at line 235 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 232 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 234 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 230 of file stream-transport-impl.hpp.