Revert "client code needs to call start() in order to start syncing"
This reverts commit 88916c2247731501bde0fb552862886638c9e222.
(Alex: SyncLogic automatically starts upon creation)
diff --git a/model/sync-app-socket.h b/model/sync-app-socket.h
index 7c01cf2..e6f1df1 100644
--- a/model/sync-app-socket.h
+++ b/model/sync-app-socket.h
@@ -70,11 +70,6 @@
*/
void remove (const std::string &prefix) {m_syncLogic.remove(prefix);}
- /**
- * @brief start sync process
- */
- void start() {m_syncLogic.start();}
-
private:
CcnxWrapperPtr m_appHandle;
diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index c8452dc..cd74f2b 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -48,7 +48,6 @@
m_ccnxHandle->setInterestFilter (syncPrefix,
bind (&SyncLogic::respondSyncInterest, this, _1));
- sendSyncInterest ();
m_scheduler.schedule (posix_time::seconds (4),
bind (&SyncLogic::sendSyncInterest, this),
REEXPRESSING_INTEREST);
@@ -62,7 +61,7 @@
void
SyncLogic::respondSyncInterest (const string &interest)
{
- // cout << "Respond Sync Interest" << endl;
+ //cout << "Respond Sync Interest" << endl;
string hash = interest.substr(interest.find_last_of("/") + 1);
DigestPtr digest = make_shared<Digest> ();
try
@@ -119,7 +118,7 @@
void
SyncLogic::processSyncData (const string &name, const string &dataBuffer)
{
- // cout << "Process Sync Data" <<endl;
+ //cout << "Process Sync Data" <<endl;
DiffStatePtr diffLog = make_shared<DiffState> ();
try
@@ -212,7 +211,7 @@
void
SyncLogic::processPendingSyncInterests (DiffStatePtr &diffLog)
{
- //cout << "Process Pending Interests" <<endl;
+ //cout << "Process Pending Interests" <<endl;
recursive_mutex::scoped_lock lock (m_stateMutex);
diffLog->setDigest(m_state.getDigest());
@@ -237,7 +236,7 @@
void
SyncLogic::addLocalNames (const string &prefix, uint32_t session, uint32_t seq)
{
- //cout << "Add local names" <<endl;
+ //cout << "Add local names" <<endl;
recursive_mutex::scoped_lock lock (m_stateMutex);
NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix);
SeqNo seqN(session, seq);
@@ -265,7 +264,7 @@
void
SyncLogic::sendSyncInterest ()
{
- // cout << "Sending Sync Interest" << endl;
+ //cout << "Sending Sync Interest" << endl;
recursive_mutex::scoped_lock lock (m_stateMutex);
ostringstream os;
diff --git a/model/sync-logic.h b/model/sync-logic.h
index da0a7fa..b5a4174 100644
--- a/model/sync-logic.h
+++ b/model/sync-logic.h
@@ -88,11 +88,6 @@
*/
void remove (const std::string &prefix);
- /**
- * @brief start the sync process
- */
- void start();
-
#ifdef _DEBUG
Scheduler &
getScheduler () { return m_scheduler; }
diff --git a/test/test_app_socket.cc b/test/test_app_socket.cc
index 016ef54..4ef86c9 100644
--- a/test/test_app_socket.cc
+++ b/test/test_app_socket.cc
@@ -74,9 +74,6 @@
SyncAppSocket s1(syncPrefix, f1), s2(syncPrefix, f2), s3(syncPrefix, f3);
- s1.start();
- s2.start();
- s3.start();
// single source
string data0 = "Very funny Scotty, now beam down my clothes";