本文整理汇总了Python中pyndn.Interest.refreshNonce方法的典型用法代码示例。如果您正苦于以下问题:Python Interest.refreshNonce方法的具体用法?Python Interest.refreshNonce怎么用?Python Interest.refreshNonce使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyndn.Interest
的用法示例。
在下文中一共展示了Interest.refreshNonce方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: beforeReplyTimeout
# 需要导入模块: from pyndn import Interest [as 别名]
# 或者: from pyndn.Interest import refreshNonce [as 别名]
def beforeReplyTimeout(self, interest, onVerified, onVerifyFailed, onTimeout):
newInterest = Interest(interest)
newInterest.refreshNonce()
self._face.expressInterest(newInterest,
lambda i, d : self.onData(i, d, onVerified, onVerifyFailed, onTimeout),
lambda i: self.beforeReplyTimeout(i, onVerified, onVerifyFailed, onTimeout))
onTimeout(interest)
return
示例2: onTrustSchemaTimeout
# 需要导入模块: from pyndn import Interest [as 别名]
# 或者: from pyndn.Interest import refreshNonce [as 别名]
def onTrustSchemaTimeout(self, interest, onUpdateSuccess, onUpdateFailed):
print("Trust schema interest times out: " + interest.getName().toUri())
newInterest = Interest(interest)
newInterest.refreshNonce()
self._face.expressInterest(newInterest,
lambda interest, data: self.onTrustSchemaData(interest, data, onUpdateSuccess, onUpdateFailed),
lambda interest: self.onTrustSchemaTimeout(interest, onUpdateSuccess, onUpdateFailed))
return
示例3: test_refresh_nonce
# 需要导入模块: from pyndn import Interest [as 别名]
# 或者: from pyndn.Interest import refreshNonce [as 别名]
def test_refresh_nonce(self):
interest = Interest(self.referenceInterest)
oldNonce = interest.getNonce()
self.assertEqual(4, oldNonce.size())
interest.refreshNonce()
self.assertEqual(oldNonce.size(), interest.getNonce().size(),
"The refreshed nonce should be the same size")
self.assertFalse(interest.getNonce().equals(oldNonce),
"The refreshed nonce should be different")
示例4: beforeReplyVerificationFailed
# 需要导入模块: from pyndn import Interest [as 别名]
# 或者: from pyndn.Interest import refreshNonce [as 别名]
def beforeReplyVerificationFailed(self, data, interest, onVerified, onVerifyFailed, onTimeout):
# for now internal to the library: verification failed cause the library to retransmit the interest after some time
newInterest = Interest(interest)
newInterest.refreshNonce()
dummyInterest = Interest(Name("/local/timeout"))
dummyInterest.setInterestLifetimeMilliseconds(self._verifyFailedRetransInterval)
self._face.expressInterest(dummyInterest,
self.onDummyData,
lambda i: self.retransmitInterest(newInterest, onVerified, onVerifyFailed, onTimeout))
onVerifyFailed(data)
return
示例5: onControllerCertTimeout
# 需要导入模块: from pyndn import Interest [as 别名]
# 或者: from pyndn.Interest import refreshNonce [as 别名]
def onControllerCertTimeout(self, interest, onSetupComplete, onSetupFailed, controllerCertRetries):
print "Controller certificate interest times out"
newInterest = Interest(interest)
newInterest.refreshNonce()
if controllerCertRetries == 0:
if onSetupFailed:
onSetupFailed("Controller certificate interest times out")
else:
print "Set up failed: controller certificate interest times out"
else:
self._face.expressInterest(newInterest,
lambda interest, data: self.onControllerCertData(interest, data, onSetupComplete, onSetupFailed),
lambda interest: self.onControllerCertTimeout(interest, onSetupComplete, onSetupFailed, controllerCertRetries - 1))
return
示例6: onAppRequestTimeout
# 需要导入模块: from pyndn import Interest [as 别名]
# 或者: from pyndn.Interest import refreshNonce [as 别名]
def onAppRequestTimeout(self, interest, onSetupComplete, onSetupFailed, appRequestTimeoutCnt):
print "Application publishing request times out"
newInterest = Interest(interest)
newInterest.refreshNonce()
if appRequestTimeoutCnt == 0:
if onSetupFailed:
onSetupFailed("Application publishing request times out")
else:
print "Setup failed: application publishing request times out"
else:
self._face.expressInterest(newInterest,
lambda interest, data : self.onAppRequestData(interest, data, onSetupComplete, onSetupFailed),
lambda interest : self.onAppRequestTimeout(interest, onSetupComplete, onSetupFailed, appRequestTimeoutCnt - 1))
return
示例7: expressHeartbeatInterest
# 需要导入模块: from pyndn import Interest [as 别名]
# 或者: from pyndn.Interest import refreshNonce [as 别名]
def expressHeartbeatInterest(self, dummyInterest, entityInterest):
newInterest = Interest(entityInterest)
newInterest.refreshNonce()
self._face.expressInterest(newInterest, self.onHeartbeatData, self.onHeartbeatTimeout)