|
| | Face () |
| | Create a new Face using the default transport (UnixTransport) More...
|
| |
| | Face (const shared_ptr< boost::asio::io_service > &ioService) |
| | Create a new Face using the default transport (UnixTransport) More...
|
| |
| | Face (boost::asio::io_service &ioService) |
| | Create a new Face using the default transport (UnixTransport) More...
|
| |
| | Face (const std::string &host, const std::string &port="6363") |
| | Create a new Face using TcpTransport. More...
|
| |
| | Face (const shared_ptr< Transport > &transport) |
| | Create a new Face using the given Transport. More...
|
| |
| | Face (const shared_ptr< Transport > &transport, boost::asio::io_service &ioService) |
| | Create a new Face using the given Transport and IO service object. More...
|
| |
| void | setController (const shared_ptr< Controller > &controller) |
| | Set controller used for prefix registration. More...
|
| |
| const PendingInterestId * | expressInterest (const Interest &interest, const OnData &onData, const OnTimeout &onTimeout=OnTimeout()) |
| | Express Interest. More...
|
| |
| const PendingInterestId * | expressInterest (const Name &name, const Interest &tmpl, const OnData &onData, const OnTimeout &onTimeout=OnTimeout()) |
| | Express Interest using name and Interest template. More...
|
| |
| void | removePendingInterest (const PendingInterestId *pendingInterestId) |
| | Remove the pending interest entry with the pendingInterestId from the pending interest table. More...
|
| |
| const RegisteredPrefixId * | setInterestFilter (const Name &prefix, const OnInterest &onInterest, const OnSetInterestFilterFailed &onSetInterestFilterFailed) |
| | Register prefix with the connected NDN hub and call onInterest when a matching interest is received. More...
|
| |
| void | unsetInterestFilter (const RegisteredPrefixId *registeredPrefixId) |
| | Remove the registered prefix entry with the registeredPrefixId from the pending interest table. More...
|
| |
| void | put (const Data &data) |
| | Publish data packet. More...
|
| |
| void | processEvents (const time::milliseconds &timeout=time::milliseconds::zero(), bool keepThread=false) |
| | Process any data to receive or call timeout callbacks. More...
|
| |
| void | shutdown () |
| | Shutdown face operations. More...
|
| |
shared_ptr
< boost::asio::io_service > | ioService () |
| | Get shared_ptr of the IO service object. More...
|
| |
| boost::asio::io_service & | getIoService () |
| | Get reference to IO service object. More...
|
| |
Abstraction to communicate with local or remote NDN forwarder.
Definition at line 54 of file face.hpp.
| void ndn::Face::processEvents |
( |
const time::milliseconds & |
timeout = time::milliseconds::zero(), |
|
|
bool |
keepThread = false |
|
) |
| |
Process any data to receive or call timeout callbacks.
This call will block forever (default timeout == 0) to process IO on the face. To exit, one expected to call face.shutdown() from one of the callback methods.
If positive timeout is specified, then processEvents will exit after this timeout, if not stopped earlier with face.shutdown() or when all active events finish. The call can be called repeatedly, if desired.
If negative timeout is specified, then processEvents will not block and process only pending events.
- Parameters
-
| timeout | maximum time to block the thread. |
| keepThread | Keep thread in a blocked state (in event processing), even when there are no outstanding events (e.g., no Interest/Data is expected) |
- 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. |
Definition at line 268 of file face.cpp.
| void ndn::Face::removePendingInterest |
( |
const PendingInterestId * |
pendingInterestId | ) |
|
Remove the pending interest entry with the pendingInterestId from the pending interest table.
This does not affect another pending interest with a different pendingInterestId, even it if has the same interest name. If there is no entry with the pendingInterestId, do nothing.
- Parameters
-
| pendingInterestId | The ID returned from expressInterest. |
Definition at line 203 of file face.cpp.
| void ndn::Face::shutdown |
( |
| ) |
|
Shutdown face operations.
This method cancels all pending operations and closes connection to NDN Forwarder.
Note that this method does not stop IO service and if the same IO service is shared between multiple Faces or with other IO objects (e.g., Scheduler).
Definition at line 309 of file face.cpp.
| void ndn::Face::unsetInterestFilter |
( |
const RegisteredPrefixId * |
registeredPrefixId | ) |
|
Remove the registered prefix entry with the registeredPrefixId from the pending interest table.
This does not affect another registered prefix with a different registeredPrefixId, even it if has the same prefix name. If there is no entry with the registeredPrefixId, do nothing.
- Parameters
-
| registeredPrefixId | The ID returned from registerPrefix. |
Definition at line 232 of file face.cpp.