|
typedef func_lib::function< void()> | OnConnected |
|
Connect according to the info in ConnectionInfo, and processEvents() will use elementListener.
- Parameters
-
connectionInfo | A reference to a UnixTransport::ConnectionInfo. |
elementListener | Not a shared_ptr because we assume that it will remain valid during the life of this object. |
onConnected | This calls onConnected() when the connection is established. |
Reimplemented from ndn::Transport.
virtual bool ndn::UnixTransport::isAsync |
( |
| ) |
|
|
virtual |
Override to return false since connect does not need to use the onConnected callback.
- Returns
- False.
Reimplemented from ndn::Transport.
Determine whether this transport connecting according to connectionInfo is to a node on the current machine.
Unix transports are always local.
- Parameters
-
connectionInfo | This is ignored. |
- Returns
- True because Unix transports are always local.
Reimplemented from ndn::Transport.
virtual void ndn::UnixTransport::processEvents |
( |
| ) |
|
|
virtual |
Process any data to receive.
For each element received, call elementListener.onReceivedElement. This is non-blocking and will return immediately if there is no data to receive. You should normally not call this directly since it is called by Face.processEvents.
- Exceptions
-
This | may throw an exception for reading data or in the callback for processing the data. If you call this from an main event loop, you may want to catch and log/disregard all exceptions. |
Implements ndn::Transport.
virtual void ndn::UnixTransport::send |
( |
const uint8_t * |
data, |
|
|
size_t |
dataLength |
|
) |
| |
|
virtual |
Send data to the host.
- Parameters
-
data | A pointer to the buffer of data to send. |
dataLength | The number of bytes in data. |
Reimplemented from ndn::Transport.
The documentation for this class was generated from the following file: