run timeoutcallback of ccnx wrapper in executor
provide selectors for interest callback
diff --git a/src/fetcher.cc b/src/fetcher.cc
index a67f76a..2192fd7 100644
--- a/src/fetcher.cc
+++ b/src/fetcher.cc
@@ -104,7 +104,7 @@
// cout << ">>> " << m_minSendSeqNo+1 << endl;
m_ccnx->sendInterest (Name (m_forwardingHint)(m_name)(m_minSendSeqNo+1),
Closure (bind(&Fetcher::OnData, this, m_minSendSeqNo+1, _1, _2),
- bind(&Fetcher::OnTimeout, this, m_minSendSeqNo+1, _1)),
+ bind(&Fetcher::OnTimeout, this, m_minSendSeqNo+1, _1, _2, _3)),
Selectors().interestLifetime (1)); // Alex: this lifetime should be changed to RTO
_LOG_DEBUG (" >>> i ok");
@@ -181,8 +181,8 @@
}
}
-Closure::TimeoutCallbackReturnValue
-Fetcher::OnTimeout (uint64_t seqno, const Ccnx::Name &name)
+void
+Fetcher::OnTimeout (uint64_t seqno, const Ccnx::Name &name, const Closure &closure, Selectors selectors)
{
_LOG_DEBUG (" <<< :( timeout " << name.getPartialName (0, name.size () - 1) << ", seq = " << seqno);
@@ -202,11 +202,10 @@
m_onFetchFailed (*this);
// this is not valid anymore, but we still should be able finish work
}
- return Closure::RESULT_OK;
}
else
{
_LOG_DEBUG ("Asking to reexpress");
- return Closure::RESULT_REEXPRESS;
+ m_ccnx->sendInterest (name, closure, selectors);
}
}
diff --git a/src/fetcher.h b/src/fetcher.h
index 6a31b5e..7ab08c9 100644
--- a/src/fetcher.h
+++ b/src/fetcher.h
@@ -86,8 +86,8 @@
void
OnData (uint64_t seqno, const Ccnx::Name &name, Ccnx::PcoPtr data);
- Ccnx::Closure::TimeoutCallbackReturnValue
- OnTimeout (uint64_t seqno, const Ccnx::Name &name);
+ void
+ OnTimeout (uint64_t seqno, const Ccnx::Name &name, const Ccnx::Closure &closure, Ccnx::Selectors selectors);
public:
boost::intrusive::list_member_hook<> m_managerListHook;
diff --git a/src/sync-core.cc b/src/sync-core.cc
index 191b92b..5a195f6 100644
--- a/src/sync-core.cc
+++ b/src/sync-core.cc
@@ -189,21 +189,19 @@
}
}
-Closure::TimeoutCallbackReturnValue
-SyncCore::handleSyncInterestTimeout(const Name &name)
+void
+SyncCore::handleSyncInterestTimeout(const Name &name, const Closure &closure, Selectors selectors)
{
// sync interest will be resent by scheduler
- return Closure::RESULT_OK;
}
-Closure::TimeoutCallbackReturnValue
-SyncCore::handleRecoverInterestTimeout(const Name &name)
+void
+SyncCore::handleRecoverInterestTimeout(const Name &name, const Closure &closure, Selectors selectors)
{
// We do not re-express recovery interest for now
// if difference is not resolved, the sync interest will trigger
// recovery anyway; so it's not so important to have recovery interest
// re-expressed
- return Closure::RESULT_OK;
}
void
@@ -322,7 +320,7 @@
}
m_ccnx->sendInterest(syncInterest,
Closure (boost::bind(&SyncCore::handleSyncData, this, _1, _2),
- boost::bind(&SyncCore::handleSyncInterestTimeout, this, _1)),
+ boost::bind(&SyncCore::handleSyncInterestTimeout, this, _1, _2, _3)),
selectors);
// if there is a pending syncSyncInterest task, reschedule it to be m_syncInterestInterval seconds from now
@@ -347,7 +345,7 @@
m_ccnx->sendInterest(recoverInterest,
Closure (boost::bind(&SyncCore::handleRecoverData, this, _1, _2),
- boost::bind(&SyncCore::handleRecoverInterestTimeout, this, _1)));
+ boost::bind(&SyncCore::handleRecoverInterestTimeout, this, _1, _2, _3)));
}
else
diff --git a/src/sync-core.h b/src/sync-core.h
index 423afcc..b804ac5 100644
--- a/src/sync-core.h
+++ b/src/sync-core.h
@@ -24,6 +24,7 @@
#include "sync-log.h"
#include "ccnx-wrapper.h"
+#include "ccnx-selectors.h"
#include "scheduler.h"
#include "task.h"
@@ -76,11 +77,11 @@
void
handleRecoverData(const Ccnx::Name &name, Ccnx::PcoPtr content);
- Ccnx::Closure::TimeoutCallbackReturnValue
- handleSyncInterestTimeout(const Ccnx::Name &name);
+ void
+ handleSyncInterestTimeout(const Ccnx::Name &name, const Ccnx::Closure &closure, Ccnx::Selectors selectors);
- Ccnx::Closure::TimeoutCallbackReturnValue
- handleRecoverInterestTimeout(const Ccnx::Name &name);
+ void
+ handleRecoverInterestTimeout(const Ccnx::Name &name, const Ccnx::Closure &closure, Ccnx::Selectors selectors);
void
deregister(const Ccnx::Name &name);