poke: wait indefinitely if --timeout is not specified
Change-Id: I0051e65d27780d8b58a0c0febf3572b0c6a23e8c
This commit is contained in:
1 parent
94dff006fc
commit
de01c81a92
2 files changed
+7
-5
No files matched your search
@@ -60,10 +60,12 @@ NdnPoke::start()
|
||||
m_registeredPrefix.cancel();
|
||||
},
|
||||
[this] (auto&&) {
|
||||
m_timeoutEvent = m_scheduler.schedule(m_options.timeout, [this] {
|
||||
m_result = Result::TIMEOUT;
|
||||
m_registeredPrefix.cancel();
|
||||
});
|
||||
if (m_options.timeout) {
|
||||
m_timeoutEvent = m_scheduler.schedule(*m_options.timeout, [this] {
|
||||
m_result = Result::TIMEOUT;
|
||||
m_registeredPrefix.cancel();
|
||||
});
|
||||
}
|
||||
},
|
||||
[this] (auto&&, const auto& reason) {
|
||||
m_result = Result::PREFIX_REG_FAIL;
|
||||
|
||||
@@ -48,7 +48,7 @@ struct PokeOptions
|
||||
|
||||
// program behavior options
|
||||
bool wantForceData = false;
|
||||
time::milliseconds timeout = 10_s;
|
||||
optional<time::milliseconds> timeout;
|
||||
};
|
||||
|
||||
class NdnPoke : boost::noncopyable
|
||||
|
||||
Reference in new issue
Block a user