示例#1
0
文件: node.cpp 项目: susmit85/ndn-cpp
void
Node::processInterestTimeout(ptr_lib::shared_ptr<PendingInterest> pendingInterest)
{
  if (pendingInterest->getIsRemoved())
    // extractEntriesForExpressedInterest or removePendingInterest has removed 
    // pendingInterest from pendingInterestTable_, so we don't need to look for
    // it. Do nothing.
    return;

  // Find the entry.
  for (vector<ptr_lib::shared_ptr<PendingInterest> >::iterator entry =
         pendingInterestTable_.begin();
       entry != pendingInterestTable_.end();
       ++entry) {
    if (entry->get() == pendingInterest.get()) {
      pendingInterestTable_.erase(entry);
      pendingInterest->callTimeout();
      return;
    }
  }

  // The pending interest has been removed. Do nothing.
}