node: Small complication to allow (in future) aggregation of Face processing threads
Change-Id: Ia318d4cee7da7ed1e0f069409e86f3e12f62b816
diff --git a/include/ndn-cpp/node.hpp b/include/ndn-cpp/node.hpp
index 4092330..b785be4 100644
--- a/include/ndn-cpp/node.hpp
+++ b/include/ndn-cpp/node.hpp
@@ -50,6 +50,20 @@
* @param transport A shared_ptr to a Transport::ConnectionInfo to be used to connect to the transport.
*/
Node(const ptr_lib::shared_ptr<Transport>& transport);
+
+ /**
+ * @brief Alternative (special use case) version of the constructor, can be used to aggregate
+ * several Faces within one processing thread
+ *
+ * <code>
+ * Face face1(...);
+ * Face face2(..., face1.getAsyncService());
+ *
+ * // Now the following ensures that events on both faces are processed
+ * face1.processEvents();
+ * </code>
+ */
+ Node(const ptr_lib::shared_ptr<Transport>& transport, const ptr_lib::shared_ptr<boost::asio::io_service> &ioService);
/**
* Send the Interest through the transport, read the entire response and call onData(interest, data).
@@ -131,11 +145,7 @@
void
onReceiveElement(const Block &wire);
- void
- onTransportError();
-
- struct ProcessEventsTimeout {};
-
+ struct ProcessEventsTimeout {};
static void
fireProcessEventsTimeout(const boost::system::error_code& error);
@@ -305,9 +315,9 @@
checkPitExpire();
private:
- boost::asio::io_service ioService_;
- boost::asio::deadline_timer timer_;
- boost::asio::deadline_timer processEventsTimeoutTimer_;
+ ptr_lib::shared_ptr<boost::asio::io_service> ioService_;
+ ptr_lib::shared_ptr<boost::asio::deadline_timer> pitTimeoutCheckTimer_;
+ ptr_lib::shared_ptr<boost::asio::deadline_timer> processEventsTimeoutTimer_;
ptr_lib::shared_ptr<Transport> transport_;