comm: Create SyncSocket on initialization
refs: #2649
Change-Id: I9e5891b8ad5de9a6ff6ac4edab4bab1564a309c8
diff --git a/src/communication/sync-logic-handler.hpp b/src/communication/sync-logic-handler.hpp
index 36caae7..7df3671 100644
--- a/src/communication/sync-logic-handler.hpp
+++ b/src/communication/sync-logic-handler.hpp
@@ -44,10 +44,17 @@
class SyncLogicHandler
{
public:
- SyncLogicHandler(ndn::Face& face, Lsdb& lsdb, ConfParameter& conf, SequencingManager& seqManager);
+ class Error : public std::runtime_error
+ {
+ public:
+ explicit
+ Error(const std::string& what)
+ : std::runtime_error(what)
+ {
+ }
+ };
- void
- createSyncSocket();
+ SyncLogicHandler(ndn::Face& face, Lsdb& lsdb, ConfParameter& conf, SequencingManager& seqManager);
void
onNsyncUpdate(const std::vector<Sync::MissingDataInfo>& v, Sync::SyncSocket* socket);
@@ -59,15 +66,12 @@
publishRoutingUpdate();
void
- setSyncPrefix(const std::string& sp)
- {
- m_syncPrefix = sp;
- }
+ createSyncSocket(const ndn::Name& syncPrefix);
+private:
void
buildUpdatePrefix();
-private:
void
processUpdateFromSync(const SyncUpdate& updateName);