Hard-code fixed session name for ChronoSync sockets
This commit reverts behavior of the hard-coded fixed session name that
was feature in old nsync-based implementation.
Also fixing an initialized configuration parameter.
refs: #4513
Change-Id: I44559e729c949f90511a5c53282fd4a240356157
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 6257be5..5226ed4 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -71,20 +71,21 @@
// of the object
std::shared_ptr<ndn::Face> facePtr(&m_syncFace, NullDeleter<ndn::Face>());
+ const auto fixedSession = ndn::name::Component::fromNumber(0);
m_syncSocket = std::make_shared<chronosync::Socket>(m_syncPrefix, m_nameLsaUserPrefix, *facePtr,
std::bind(&SyncLogicHandler::onChronoSyncUpdate, this, _1),
chronosync::Socket::DEFAULT_NAME, chronosync::Socket::DEFAULT_VALIDATOR,
- syncInterestLifetime);
+ syncInterestLifetime, fixedSession);
if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_OFF) {
- m_syncSocket->addSyncNode(m_adjLsaUserPrefix);
+ m_syncSocket->addSyncNode(m_adjLsaUserPrefix, chronosync::Socket::DEFAULT_NAME, fixedSession);
}
else if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_ON) {
- m_syncSocket->addSyncNode(m_coorLsaUserPrefix);
+ m_syncSocket->addSyncNode(m_coorLsaUserPrefix, chronosync::Socket::DEFAULT_NAME, fixedSession);
}
else {
- m_syncSocket->addSyncNode(m_adjLsaUserPrefix);
- m_syncSocket->addSyncNode(m_coorLsaUserPrefix);
+ m_syncSocket->addSyncNode(m_adjLsaUserPrefix, chronosync::Socket::DEFAULT_NAME, fixedSession);
+ m_syncSocket->addSyncNode(m_coorLsaUserPrefix, chronosync::Socket::DEFAULT_NAME, fixedSession);
}
}
diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp
index 549d353..8c0e1a9 100644
--- a/src/conf-parameter.hpp
+++ b/src/conf-parameter.hpp
@@ -143,6 +143,7 @@
, m_hyperbolicState(HYPERBOLIC_STATE_OFF)
, m_corR(0)
, m_maxFacesPerPrefix(MAX_FACES_PER_PREFIX_MIN)
+ , m_syncInterestLifetime(ndn::time::milliseconds(SYNC_INTEREST_LIFETIME_DEFAULT))
{
}