Provides TLV-block delivery service.  
 More...
#include <ndn-cxx/transport/transport.hpp>
Provides TLV-block delivery service. 
Definition at line 35 of file transport.hpp.
◆ ErrorCallback
◆ ReceiveCallback
◆ ~Transport()
  
  | 
        
          | virtual ndn::Transport::~Transport | ( |  | ) |  |  | virtualdefault | 
 
 
◆ close()
  
  | 
        
          | virtual void ndn::Transport::close | ( |  | ) |  |  | pure virtual | 
 
 
◆ connect()
  
  | 
        
          | void ndn::Transport::connect | ( | boost::asio::io_service & | ioService, |  
          |  |  | ReceiveCallback | receiveCallback |  
          |  | ) |  |  |  | virtual | 
 
Asynchronously open the connection. 
- Parameters
- 
  
    | ioService | io_service to create socket on |  | receiveCallback | callback function when a TLV block is received; must not be empty |  
 
- Exceptions
- 
  
    | boost::system::system_error | connection cannot be established |  
 
Reimplemented in ndn::TcpTransport, and ndn::UnixTransport.
Definition at line 32 of file transport.cpp.
 
 
◆ isConnected()
  
  | 
        
          | bool ndn::Transport::isConnected | ( |  | ) | const |  | inlinenoexcept | 
 
- Return values
- 
  
    | true | connection has been established |  | false | connection is not yet established or has been closed |  
 
Definition at line 98 of file transport.hpp.
 
 
◆ isReceiving()
  
  | 
        
          | bool ndn::Transport::isReceiving | ( |  | ) | const |  | inlinenoexcept | 
 
- Return values
- 
  
    | true | incoming packets are expected, the receive callback will be invoked |  | false | incoming packets are not expected, the receive callback will not be invoked |  
 
Definition at line 107 of file transport.hpp.
 
 
◆ pause()
  
  | 
        
          | virtual void ndn::Transport::pause | ( |  | ) |  |  | pure virtual | 
 
pause the transport 
- Postcondition
- the receive callback will not be invoked 
- Note
- This operation has no effect if transport has been paused, or when connection is being established. 
Implemented in ndn::TcpTransport, and ndn::UnixTransport.
 
 
◆ resume()
  
  | 
        
          | virtual void ndn::Transport::resume | ( |  | ) |  |  | pure virtual | 
 
resume the transport 
- Postcondition
- the receive callback will be invoked 
- Note
- This operation has no effect if transport is not paused, or when connection is being established. 
Implemented in ndn::TcpTransport, and ndn::UnixTransport.
 
 
◆ send() [1/2]
  
  | 
        
          | virtual void ndn::Transport::send | ( | const Block & | wire | ) |  |  | pure virtual | 
 
 
◆ send() [2/2]
  
  | 
        
          | virtual void ndn::Transport::send | ( | const Block & | header, |  
          |  |  | const Block & | payload |  
          |  | ) |  |  |  | pure virtual | 
 
send two memory blocks through the transport 
Scatter/gather API is utilized to send two non-consecutive memory blocks together (as part of the same message in datagram-oriented transports). 
Implemented in ndn::TcpTransport, and ndn::UnixTransport.
 
 
◆ m_ioService
  
  | 
        
          | boost::asio::io_service* ndn::Transport::m_ioService = nullptr |  | protected | 
 
 
◆ m_isConnected
  
  | 
        
          | bool ndn::Transport::m_isConnected = false |  | protected | 
 
 
◆ m_isReceiving
  
  | 
        
          | bool ndn::Transport::m_isReceiving = false |  | protected | 
 
 
◆ m_receiveCallback