util: DummyClientFace can override processEvents
refs #3769
Change-Id: Idf8b674ed238f296c7c4293b19a6f769cbd7e332
diff --git a/src/util/dummy-client-face.cpp b/src/util/dummy-client-face.cpp
index a1c6408..43efff9 100644
--- a/src/util/dummy-client-face.cpp
+++ b/src/util/dummy-client-face.cpp
@@ -20,6 +20,7 @@
*/
#include "dummy-client-face.hpp"
+#include "../lp/packet.hpp"
#include "../lp/tags.hpp"
#include "../mgmt/nfd/controller.hpp"
#include "../mgmt/nfd/control-response.hpp"
@@ -30,8 +31,6 @@
namespace ndn {
namespace util {
-const DummyClientFace::Options DummyClientFace::DEFAULT_OPTIONS{true, false};
-
class DummyClientFace::Transport : public ndn::Transport
{
public:
@@ -163,6 +162,8 @@
if (options.enableRegistrationReply)
this->enableRegistrationReply();
+
+ m_processEventsOverride = options.processEventsOverride;
}
void
@@ -250,5 +251,16 @@
static_pointer_cast<Transport>(getTransport())->receive(lpPacket.wireEncode());
}
+void
+DummyClientFace::doProcessEvents(const time::milliseconds& timeout, bool keepThread)
+{
+ if (m_processEventsOverride != nullptr) {
+ m_processEventsOverride(timeout);
+ }
+ else {
+ this->Face::doProcessEvents(timeout, keepThread);
+ }
+}
+
} // namespace util
} // namespace ndn