a transport using Unix stream socket
More...
#include <ndn-cxx/transport/unix-transport.hpp>
a transport using Unix stream socket
Definition at line 40 of file unix-transport.hpp.
◆ ErrorCallback
◆ ReceiveCallback
◆ UnixTransport()
ndn::UnixTransport::UnixTransport |
( |
const std::string & |
unixSocket | ) |
|
|
explicit |
◆ ~UnixTransport()
ndn::UnixTransport::~UnixTransport |
( |
| ) |
|
|
overridedefault |
◆ close()
void ndn::UnixTransport::close |
( |
| ) |
|
|
overridevirtual |
◆ connect()
void ndn::UnixTransport::connect |
( |
boost::asio::io_service & |
ioService, |
|
|
ReceiveCallback |
receiveCallback |
|
) |
| |
|
overridevirtual |
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 from ndn::Transport.
Definition at line 80 of file unix-transport.cpp.
◆ create()
shared_ptr< UnixTransport > ndn::UnixTransport::create |
( |
const std::string & |
uri | ) |
|
|
static |
Create transport with parameters defined in URI.
- Exceptions
-
Definition at line 74 of file unix-transport.cpp.
◆ isConnected()
bool ndn::Transport::isConnected |
( |
| ) |
const |
|
inlinenoexceptinherited |
Return whether the transport is connected.
Definition at line 95 of file transport.hpp.
◆ isReceiving()
bool ndn::Transport::isReceiving |
( |
| ) |
const |
|
inlinenoexceptinherited |
- 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 105 of file transport.hpp.
◆ pause()
void ndn::UnixTransport::pause |
( |
| ) |
|
|
overridevirtual |
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.
Implements ndn::Transport.
Definition at line 109 of file unix-transport.cpp.
◆ resume()
void ndn::UnixTransport::resume |
( |
| ) |
|
|
overridevirtual |
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.
Implements ndn::Transport.
Definition at line 118 of file unix-transport.cpp.
◆ send()
void ndn::UnixTransport::send |
( |
const Block & |
block | ) |
|
|
overridevirtual |
◆ m_ioService
boost::asio::io_service* ndn::Transport::m_ioService = nullptr |
|
protectedinherited |
◆ m_isConnected
bool ndn::Transport::m_isConnected = false |
|
protectedinherited |
◆ m_isReceiving
bool ndn::Transport::m_isReceiving = false |
|
protectedinherited |
◆ m_receiveCallback