当前位置: 首页>>代码示例>>Python>>正文


Python Interest.refreshNonce方法代码示例

本文整理汇总了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
开发者ID:remap,项目名称:ndn-flow,代码行数:10,代码来源:app_consumer_sequence_number.py

示例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
开发者ID:remap,项目名称:ndn-flow,代码行数:10,代码来源:bootstrap.py

示例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")
开发者ID:MAHIS,项目名称:PyNDN2,代码行数:12,代码来源:test_interest_methods.py

示例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
开发者ID:remap,项目名称:ndn-flow,代码行数:14,代码来源:app_consumer_sequence_number.py

示例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
开发者ID:remap,项目名称:ndn-flow,代码行数:16,代码来源:bootstrap.py

示例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
开发者ID:remap,项目名称:ndn-flow,代码行数:17,代码来源:bootstrap.py

示例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)
开发者ID:remap,项目名称:ndn-flow,代码行数:6,代码来源:sync_based_discovery.py


注:本文中的pyndn.Interest.refreshNonce方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。