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

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

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

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

Public Member Functions

 StreamTransportImpl (BaseTransport &transport, boost::asio::io_context &ioCtx)
 
void close ()
 
void connect (const typename Protocol::endpoint &endpoint)
 
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)
 

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::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, e.g., boost::asio::ip::tcp or boost::asio::local::stream_protocol

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

Member Typedef Documentation

◆ TransmissionQueue

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

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

Constructor & Destructor Documentation

◆ StreamTransportImpl()

template<typename BaseTransport , typename Protocol >
ndn::detail::StreamTransportImpl< BaseTransport, Protocol >::StreamTransportImpl ( BaseTransport &  transport,
boost::asio::io_context &  ioCtx 
)
inline

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

Member Function Documentation

◆ asyncReceive()

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

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

◆ asyncWrite()

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

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

◆ close()

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

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

◆ connect()

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

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

◆ connectHandler()

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

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

◆ pause()

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

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

◆ resume()

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

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)
inline

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
protected

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
protected

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
protected

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
protected

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
protected

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
protected

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
protected

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