本文整理汇总了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()
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)