本文整理汇总了Python中pyndn.Interest.getInterestLifetimeMilliseconds方法的典型用法代码示例。如果您正苦于以下问题:Python Interest.getInterestLifetimeMilliseconds方法的具体用法?Python Interest.getInterestLifetimeMilliseconds怎么用?Python Interest.getInterestLifetimeMilliseconds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyndn.Interest
的用法示例。
在下文中一共展示了Interest.getInterestLifetimeMilliseconds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: expressInterestPirAndRepeat
# 需要导入模块: from pyndn import Interest [as 别名]
# 或者: from pyndn.Interest import getInterestLifetimeMilliseconds [as 别名]
def expressInterestPirAndRepeat(self):
self.log.debug("callbackCountUniqueData: " + str(self._callbackCountUniqueData) + ", callbackCountTimeout: " + str(self._callbackCountTimeout))
# Express interest for each pir we have discovered
for pir in self.getPirs():
interest = Interest(Name(pir.id))
interest.setExclude(pir.status.getExclude())
interest.setInterestLifetimeMilliseconds(1000.0)
interest.setChildSelector(1)
self.face.expressInterest(interest, self.onDataPir, self.onTimeoutPir)
self._countExpressedInterests += 1
debugStr = "Sent interest: " + interest.getName().toUri()
debugStr += "\tExclude: " + interest.getExclude().toUri()
debugStr += "\tLifetime: " + str(interest.getInterestLifetimeMilliseconds())
self.log.debug(debugStr)
# Reschedule again in 0.5 sec
self.loop.call_later(1.0, self.expressInterestPirAndRepeat)