本文整理汇总了Python中twisted.internet.protocol.ClientFactory.clientConnectionLost方法的典型用法代码示例。如果您正苦于以下问题:Python ClientFactory.clientConnectionLost方法的具体用法?Python ClientFactory.clientConnectionLost怎么用?Python ClientFactory.clientConnectionLost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.internet.protocol.ClientFactory
的用法示例。
在下文中一共展示了ClientFactory.clientConnectionLost方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: clientConnectionLost
# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionLost [as 别名]
def clientConnectionLost(self, connector, unused_reason):
self.clientProxy.nodeLocator.remove(self.address)
if hasattr(self, 'deferred') and not self.deferred.called:
self.reactor.callLater(0, self.deferred.errback, unused_reason)
del self.deferred
ClientFactory.clientConnectionLost(
self, connector, unused_reason)
示例2: clientConnectionLost
# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionLost [as 别名]
def clientConnectionLost(self, connector, reason):
logger.info('lost connection: %s', reason.getErrorMessage())
ClientFactory.clientConnectionLost(self, connector, reason)
if self.reconnect:
time.sleep(self.reconnect_delay)
connector.connect()
elif not self.protocols:
if self.onFinish:
self.onFinish.callback(None)
示例3: clientConnectionLost
# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionLost [as 别名]
def clientConnectionLost(self, connector, reason):
# Disable modules
if connector.host in self.bot.moduleHandler.enabledModules:
for module in self.bot.moduleHandler.enabledModules[connector.host]:
self.bot.moduleHandler.disableModule(module, connector.host, True)
self.bot.moduleHandler.runGenericAction("disconnect", connector.host)
del self.bot.servers[connector.host]
# Check whether or not we should reconnect
if connector.host in self.currentlyDisconnecting:
self.bot.log.info("Connection to {connector.host} was closed cleanly.", connector=connector)
ClientFactory.clientConnectionLost(self, connector, reason)
self.currentlyDisconnecting.remove(connector.host)
self.bot.countConnections()
else:
ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
示例4: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionLost [as 别名]
def clientConnectionFailed(self, connector, reason):
log.msg('APNSFeedbackClientFactory clientConnectionFailed reason=%s' % reason)
ClientFactory.clientConnectionLost(self, connector, reason)
示例5: clientConnectionLost
# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionLost [as 别名]
def clientConnectionLost(self, connector, reason):
log.msg('Lost connection. Reason:', reason)
ClientFactory.clientConnectionLost(self, connector, reason)
示例6: clientConnectionLost
# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionLost [as 别名]
def clientConnectionLost(self, connector, reason):
logger.debug("%s: BaseClient::clientConnectionLost(): %s",
self.protocol_name, reason)
self.session = None
return ClientFactory.clientConnectionLost(self, connector, reason)
示例7: clientConnectionLost
# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionLost [as 别名]
def clientConnectionLost(self, connector, reason):
ClientFactory.clientConnectionLost(self, connector, reason)
示例8: clientConnectionLost
# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionLost [as 别名]
def clientConnectionLost(self, connector, reason):
ClientFactory.clientConnectionLost(self, connector, reason)
del(self.connections[str(connector.host)])
示例9: clientConnectionLost
# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionLost [as 别名]
def clientConnectionLost(self, connector, reason):
logger.info('lost connection: {}'.format(reason))
ClientFactory.clientConnectionLost(self, connector, reason)
if self.reconnect:
reactor.callFromThread(time.sleep, self.reconnect_delay)
connector.connect()
示例10: clientConnectionLost
# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionLost [as 别名]
def clientConnectionLost(self, connector, reason):
if hasattr(connector.transport, "fullDisconnect") and connector.transport.fullDisconnect:
ClientFactory.clientConnectionLost(self, connector, reason)
else:
ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
示例11: clientConnectionLost
# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionLost [as 别名]
def clientConnectionLost(self, connector, reason):
log.msg("APNSFeedbackClientFactory clientConnectionLost reason=%s" % reason)
ClientFactory.clientConnectionLost(self, connector, reason)