Provides a "TLV-oriented" delivery service.
More...
#include <ndn-cxx/transport/transport.hpp>
Provides a "TLV-oriented" delivery service.
Definition at line 36 of file transport.hpp.
◆ ReceiveCallback
◆ State
Enumerator |
---|
CLOSED | |
CONNECTING | |
RUNNING | |
PAUSED | |
Definition at line 47 of file transport.hpp.
◆ ~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::UnixTransport, and ndn::TcpTransport.
Definition at line 32 of file transport.cpp.
◆ getState()
State ndn::Transport::getState |
( |
| ) |
const |
|
inlinenoexcept |
Return the current state of the transport.
Definition at line 103 of file transport.hpp.
◆ pause()
virtual void ndn::Transport::pause |
( |
| ) |
|
|
pure virtual |
Pause the transport, canceling all pending operations.
- Postcondition
- the receive callback will not be invoked
- Note
- This operation has no effect if the transport has been paused, or when the connection is being established.
Implemented in ndn::UnixTransport, and ndn::TcpTransport.
◆ 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 the transport is not paused, or when the connection is being established.
Implemented in ndn::UnixTransport, and ndn::TcpTransport.
◆ send()
virtual void ndn::Transport::send |
( |
const Block & |
block | ) |
|
|
pure virtual |
◆ setState()
void ndn::Transport::setState |
( |
State |
state | ) |
|
|
inlineprotectednoexcept |
◆ m_ioService
boost::asio::io_service* ndn::Transport::m_ioService = nullptr |
|
protected |
◆ m_receiveCallback