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


Python ReconnectingClientFactory.retry方法代码示例

本文整理汇总了Python中twisted.internet.protocol.ReconnectingClientFactory.retry方法的典型用法代码示例。如果您正苦于以下问题:Python ReconnectingClientFactory.retry方法的具体用法?Python ReconnectingClientFactory.retry怎么用?Python ReconnectingClientFactory.retry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.internet.protocol.ReconnectingClientFactory的用法示例。


在下文中一共展示了ReconnectingClientFactory.retry方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import retry [as 别名]
 def clientConnectionLost(self, connector, reason):
     #f = ReconnectingClientFactory()
     #ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
     if(self.state!=ChatStateEnum.closing):
         print 'Lost connection.  Reason:', reason
         ReconnectingClientFactory.retry(ReconnectingClientFactory(), connector)
     else:
         reactor.stop()
开发者ID:MachineRunning,项目名称:twistedExperiments,代码行数:10,代码来源:twisted_proto_client.py

示例2: retry

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import retry [as 别名]
 def retry(self, connector=None):
     state = self.gstElement.get_state(timeout=100*gst.MSECOND)
     #print "FGDPClientFactory.retry", state
     #print "gst.STATE_PLAYING", state[1] == gst.STATE_PLAYING
     #print "gst.STATE_PAUSED", state[1] == gst.STATE_PAUSED
     #print "gst.STATE_READY", state[1] == gst.STATE_READY
     #print "gst.STATE_NULL", state[1] == gst.STATE_NULL
     #print "gst.STATE_VOID_PENDING", state[1] == gst.STATE_VOID_PENDING
     if state[1] == gst.STATE_PLAYING or state[1] == gst.STATE_READY:
         self.info("Trying reconnection with FGDP peer")
         return ReconnectingClientFactory.retry(self, connector)
开发者ID:lucasa,项目名称:landell-fgdp,代码行数:13,代码来源:protocol.py

示例3: retry

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import retry [as 别名]
    def retry(self, connector=None):       
        if not self.is_reconnecting:
            return

        if connector is None:
            if self.connector is None:
                raise ValueError("no connector to retry")
            else:
                connector = self.connector
        
        if self.new_host:
            # Switch to new host if any
            connector.host = self.new_host[0]
            connector.port = self.new_host[1]
            self.main_host = self.new_host
            self.new_host = None
    
        return ReconnectingClientFactory.retry(self, connector)
开发者ID:300184,项目名称:eth-stratum-mining-proxy,代码行数:20,代码来源:socket_transport.py

示例4: clientConnectionFailed

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import retry [as 别名]
 def clientConnectionFailed(self, connector, reason):
     print 'Connection failed. Reason:', reason
     #ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
     # ReconnectingClientFactory(maxDelay [sec],initialDelay [sec])
     ## maxDelay=360, no this constructor takes no arguments!
     ReconnectingClientFactory.retry(ReconnectingClientFactory(), connector)
开发者ID:MachineRunning,项目名称:twistedExperiments,代码行数:8,代码来源:twisted_proto_client.py

示例5: retry

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import retry [as 别名]
 def retry(self, connector=None):
     self.log_info("Reconnecting to APN server")
     ReconnectingClientFactory.retry(self, connector)
开发者ID:azbarcea,项目名称:calendarserver,代码行数:5,代码来源:applepush.py

示例6: retry

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import retry [as 别名]
 def retry(self, connector=None):
     MyClientProtocol.bot.say('[Websocket] Reconnecting to API Websocket in ' + str(self.delay) + ' seconds...')
     ReconnectingClientFactory.retry(self)
开发者ID:FuelRats,项目名称:pipsqueak,代码行数:5,代码来源:rat-socket.py

示例7: retry

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import retry [as 别名]
 def retry(self, connector=None):
     self.info("Trying reconnection with FGDP peer")
     return ReconnectingClientFactory.retry(self, connector)
开发者ID:ApsOps,项目名称:flumotion-orig,代码行数:5,代码来源:protocol.py


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