face: replace isOnDemand with FacePersistency
Change-Id: Ie6995b2d03bbb90faad158de2b055f72dd9ba73d
Refs: #2989
diff --git a/daemon/face/udp-face.cpp b/daemon/face/udp-face.cpp
index a854cc4..20b57cf 100644
--- a/daemon/face/udp-face.cpp
+++ b/daemon/face/udp-face.cpp
@@ -44,7 +44,7 @@
, m_idleTimeout(idleTimeout)
, m_lastIdleCheck(time::steady_clock::now())
{
- this->setOnDemand(isOnDemand);
+ this->setPersistency(isOnDemand ? ndn::nfd::FACE_PERSISTENCY_ON_DEMAND : ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
#ifdef __linux__
//
@@ -66,7 +66,7 @@
}
#endif
- if (this->isOnDemand() && m_idleTimeout > time::seconds::zero()) {
+ if (this->getPersistency() == ndn::nfd::FACE_PERSISTENCY_ON_DEMAND && m_idleTimeout > time::seconds::zero()) {
m_closeIfIdleEvent = scheduler::schedule(m_idleTimeout, bind(&UdpFace::closeIfIdle, this));
}
}
@@ -76,7 +76,7 @@
{
auto status = DatagramFace::getFaceStatus();
- if (isOnDemand()) {
+ if (this->getPersistency() == ndn::nfd::FACE_PERSISTENCY_ON_DEMAND) {
time::milliseconds left = m_idleTimeout;
left -= time::duration_cast<time::milliseconds>(time::steady_clock::now() - m_lastIdleCheck);
@@ -97,7 +97,7 @@
{
// Face can be switched from on-demand to non-on-demand mode
// (non-on-demand -> on-demand transition is not allowed)
- if (isOnDemand()) {
+ if (this->getPersistency() == ndn::nfd::FACE_PERSISTENCY_ON_DEMAND) {
if (!hasBeenUsedRecently()) {
NFD_LOG_FACE_INFO("Closing for inactivity");
close();