implementation detail of a Boost.Asio-based stream-oriented transport More...
#include <stream-transport-impl.hpp>
Public Types | |
typedef StreamTransportImpl< BaseTransport, Protocol > | Impl |
typedef std::list< Block > | BlockSequence |
typedef std::list< BlockSequence > | TransmissionQueue |
Public Member Functions | |
StreamTransportImpl (BaseTransport &transport, boost::asio::io_service &ioService) | |
void | connect (const typename Protocol::endpoint &endpoint) |
void | close () |
void | pause () |
void | resume () |
void | send (const Block &wire) |
void | send (const Block &header, const Block &payload) |
Protected Member Functions | |
void | connectHandler (const boost::system::error_code &error) |
void | connectTimeoutHandler (const boost::system::error_code &error) |
void | send (BlockSequence &&sequence) |
void | asyncWrite () |
void | handleAsyncWrite (const boost::system::error_code &error, TransmissionQueue::iterator queueItem) |
void | asyncReceive () |
void | handleAsyncReceive (const boost::system::error_code &error, std::size_t nBytesRecvd) |
bool | processAllReceived (uint8_t *buffer, size_t &offset, size_t nBytesAvailable) |
Protected Attributes | |
BaseTransport & | m_transport |
Protocol::socket | m_socket |
uint8_t | m_inputBuffer [MAX_NDN_PACKET_SIZE] |
size_t | m_inputBufferSize |
TransmissionQueue | m_transmissionQueue |
bool | m_isConnecting |
boost::asio::deadline_timer | m_connectTimer |
implementation detail of a Boost.Asio-based stream-oriented transport
BaseTransport | a subclass of Transport |
Protocol | a Boost.Asio stream-oriented protocol, including boost::asio::ip::tcp and boost::asio::local::stream_protocol |
Definition at line 38 of file stream-transport-impl.hpp.
typedef StreamTransportImpl<BaseTransport,Protocol> ndn::StreamTransportImpl< BaseTransport, Protocol >::Impl |
Definition at line 41 of file stream-transport-impl.hpp.
typedef std::list<Block> ndn::StreamTransportImpl< BaseTransport, Protocol >::BlockSequence |
Definition at line 42 of file stream-transport-impl.hpp.
typedef std::list<BlockSequence> ndn::StreamTransportImpl< BaseTransport, Protocol >::TransmissionQueue |
Definition at line 43 of file stream-transport-impl.hpp.
|
inline |
Definition at line 45 of file stream-transport-impl.hpp.
|
inline |
Definition at line 55 of file stream-transport-impl.hpp.
References ndn::StreamTransportImpl< BaseTransport, Protocol >::connectHandler(), ndn::StreamTransportImpl< BaseTransport, Protocol >::connectTimeoutHandler(), ndn::StreamTransportImpl< BaseTransport, Protocol >::m_connectTimer, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_isConnecting, and ndn::StreamTransportImpl< BaseTransport, Protocol >::m_socket.
|
inline |
Definition at line 71 of file stream-transport-impl.hpp.
References ndn::StreamTransportImpl< BaseTransport, Protocol >::m_connectTimer, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_isConnecting, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_socket, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transmissionQueue, and ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transport.
|
inline |
|
inline |
Definition at line 98 of file stream-transport-impl.hpp.
References ndn::StreamTransportImpl< BaseTransport, Protocol >::asyncReceive(), ndn::StreamTransportImpl< BaseTransport, Protocol >::m_inputBufferSize, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_isConnecting, and ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transport.
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::connectHandler().
|
inline |
Definition at line 111 of file stream-transport-impl.hpp.
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::send().
|
inline |
Definition at line 119 of file stream-transport-impl.hpp.
References ndn::StreamTransportImpl< BaseTransport, Protocol >::send().
|
inlineprotected |
Definition at line 129 of file stream-transport-impl.hpp.
References ndn::StreamTransportImpl< BaseTransport, Protocol >::asyncWrite(), ndn::StreamTransportImpl< BaseTransport, Protocol >::m_connectTimer, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_isConnecting, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transmissionQueue, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transport, and ndn::StreamTransportImpl< BaseTransport, Protocol >::resume().
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::connect(), and ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol >::resolveHandler().
|
inlineprotected |
Definition at line 150 of file stream-transport-impl.hpp.
References ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transport.
Referenced by ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol >::connect(), and ndn::StreamTransportImpl< BaseTransport, Protocol >::connect().
|
inlineprotected |
|
inlineprotected |
Definition at line 173 of file stream-transport-impl.hpp.
References ndn::StreamTransportImpl< BaseTransport, Protocol >::handleAsyncWrite(), ndn::StreamTransportImpl< BaseTransport, Protocol >::m_socket, and ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transmissionQueue.
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::connectHandler(), ndn::StreamTransportImpl< BaseTransport, Protocol >::handleAsyncWrite(), and ndn::StreamTransportImpl< BaseTransport, Protocol >::send().
|
inlineprotected |
Definition at line 181 of file stream-transport-impl.hpp.
References ndn::StreamTransportImpl< BaseTransport, Protocol >::asyncWrite(), ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transmissionQueue, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transport, and websocketpp::error::operation_canceled.
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::asyncWrite().
|
inlineprotected |
Definition at line 205 of file stream-transport-impl.hpp.
References ndn::StreamTransportImpl< BaseTransport, Protocol >::handleAsyncReceive(), ndn::StreamTransportImpl< BaseTransport, Protocol >::m_inputBuffer, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_inputBufferSize, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_socket, and ndn::MAX_NDN_PACKET_SIZE.
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::handleAsyncReceive(), and ndn::StreamTransportImpl< BaseTransport, Protocol >::resume().
|
inlineprotected |
Definition at line 213 of file stream-transport-impl.hpp.
References ndn::StreamTransportImpl< BaseTransport, Protocol >::asyncReceive(), ndn::StreamTransportImpl< BaseTransport, Protocol >::m_inputBuffer, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_inputBufferSize, ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transport, ndn::MAX_NDN_PACKET_SIZE, websocketpp::error::operation_canceled, and ndn::StreamTransportImpl< BaseTransport, Protocol >::processAllReceived().
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::asyncReceive().
|
inlineprotected |
Definition at line 251 of file stream-transport-impl.hpp.
References ndn::Block::fromBuffer(), ndn::StreamTransportImpl< BaseTransport, Protocol >::m_transport, and ndn::Block::size().
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::handleAsyncReceive().
|
protected |
Definition at line 267 of file stream-transport-impl.hpp.
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::close(), ndn::StreamTransportImpl< BaseTransport, Protocol >::connectHandler(), ndn::StreamTransportImpl< BaseTransport, Protocol >::connectTimeoutHandler(), ndn::StreamTransportImpl< BaseTransport, Protocol >::handleAsyncReceive(), ndn::StreamTransportImpl< BaseTransport, Protocol >::handleAsyncWrite(), ndn::StreamTransportImpl< BaseTransport, Protocol >::pause(), ndn::StreamTransportImpl< BaseTransport, Protocol >::processAllReceived(), ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol >::resolveHandler(), ndn::StreamTransportImpl< BaseTransport, Protocol >::resume(), and ndn::StreamTransportImpl< BaseTransport, Protocol >::send().
|
protected |
Definition at line 269 of file stream-transport-impl.hpp.
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::asyncReceive(), ndn::StreamTransportImpl< BaseTransport, Protocol >::asyncWrite(), ndn::StreamTransportImpl< BaseTransport, Protocol >::close(), ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol >::connect(), ndn::StreamTransportImpl< BaseTransport, Protocol >::connect(), ndn::StreamTransportImpl< BaseTransport, Protocol >::pause(), and ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol >::resolveHandler().
|
protected |
Definition at line 270 of file stream-transport-impl.hpp.
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::asyncReceive(), and ndn::StreamTransportImpl< BaseTransport, Protocol >::handleAsyncReceive().
|
protected |
|
protected |
Definition at line 273 of file stream-transport-impl.hpp.
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::asyncWrite(), ndn::StreamTransportImpl< BaseTransport, Protocol >::close(), ndn::StreamTransportImpl< BaseTransport, Protocol >::connectHandler(), ndn::StreamTransportImpl< BaseTransport, Protocol >::handleAsyncWrite(), and ndn::StreamTransportImpl< BaseTransport, Protocol >::send().
|
protected |
Definition at line 274 of file stream-transport-impl.hpp.
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::close(), ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol >::connect(), ndn::StreamTransportImpl< BaseTransport, Protocol >::connect(), ndn::StreamTransportImpl< BaseTransport, Protocol >::connectHandler(), ndn::StreamTransportImpl< BaseTransport, Protocol >::pause(), and ndn::StreamTransportImpl< BaseTransport, Protocol >::resume().
|
protected |
Definition at line 276 of file stream-transport-impl.hpp.
Referenced by ndn::StreamTransportImpl< BaseTransport, Protocol >::close(), ndn::StreamTransportWithResolverImpl< BaseTransport, Protocol >::connect(), ndn::StreamTransportImpl< BaseTransport, Protocol >::connect(), and ndn::StreamTransportImpl< BaseTransport, Protocol >::connectHandler().