本文整理汇总了Python中twisted.internet.protocol.ReconnectingClientFactory.clientConnectionFailed方法的典型用法代码示例。如果您正苦于以下问题:Python ReconnectingClientFactory.clientConnectionFailed方法的具体用法?Python ReconnectingClientFactory.clientConnectionFailed怎么用?Python ReconnectingClientFactory.clientConnectionFailed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.internet.protocol.ReconnectingClientFactory
的用法示例。
在下文中一共展示了ReconnectingClientFactory.clientConnectionFailed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
log.clients(
"%s::clientConnectionFailed (%s:%d) %s" % (self, connector.host, connector.port, reason.getErrorMessage())
)
self.connectFailed.callback(dict(connector=connector, reason=reason))
self.connectFailed = Deferred()
示例2: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
"""
Notify the pool that we're unable to connect
"""
if self.protocolInstance is not None:
if self.protocolInstance._lastreq and ((time() - self.protocolInstance._lastreq) >= 100):
self.stopTrying()
if self.continueTrying:
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
# pool pendings
self.pool.addPendings(self)
else:
if DEBUG:
log.msg('Sphinx factory stop', self)
if self.deferred:
self.deferred.errback(reason)
# Clean deferred
self.deferred = None
else:
# pool pendings
self.pool.delPendings(self)
if self.protocolInstance is not None:
self.pool.clientGone(self.protocolInstance)
# Clean
self.protocolInstance = None
示例3: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
global ncidsrv
if config.plugins.NcidClient.connectionVerbose.value:
Notifications.AddNotification(MessageBox, _("Connecting to NCID Server failed\n (%s)\nretrying...") % reason.getErrorMessage(), type=MessageBox.TYPE_INFO, timeout=config.plugins.NcidClient.timeout.value)
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
# config.plugins.NcidClient.enable.value = False
ncidsrv = None
示例4: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
log.info(
"Connection to %s failed; will retry in %d second%s"
% (connector.getDestination(), self.delay, "" if self.delay == 1 else "s"),
system="VOEventSubscriberFactory",
)
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
示例5: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
self.logger.warn('CmdrConnection failed: %s ' % (reason))
self.activeConnection = None
self.stateCallback(self)
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
示例6: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
"""
ParaConnFactory.clientConnectionFailed: function that is called when the
connectTCP fails to reach the host. Taken from the internet, this function
will periodically attempt to connect until the connection is successful.
"""
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
示例7: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
"""Connection failed
"""
print 'Connection failed. Reason:', reason
ReconnectingClientFactory.clientConnectionFailed(self,
connector,
reason)
示例8: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
""" *******************************************************
Called when a connection has failed to connect
@type reason: L{twisted.python.fialure.Failure}
******************************************************* """
print 'Connection fialed. Reason:', reason
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
示例9: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
log.msg("Connection failed. Reason: %s" % reason, logLevel=INFO)
if getattr(self, "restart", True):
self.reset_protocol_for_login()
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
else:
log.msg("Done - no restart", logLevel=INFO)
reactor.callWhenRunning(reactor.stop)
示例10: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
"""
self.CONNECTION_INFO ok
"""
self.continueTrying = None
log.msg('Connection failed. Reason: ', reason)
ReconnectingClientFactory.clientConnectionFailed(self,\
connector, reason)
示例11: clientConnectionLost
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionLost(self, connector, reason):
log.info(
"Connection to %s lost; will retry in %d second%s" %
(connector.getDestination(), self.delay, "" if self.delay == 1 else "s"),
system="VOEventSubscriberFactory"
)
if self.reset_call.active():
self.reset_call.cancel()
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
示例12: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
logging.debug('Connection failed to Envisalink. Reason: %s', str(reason))
if hasattr(self, "_currentLoopingCall"):
try:
self._currentLoopingCall.stop()
except:
logging.error("Error trying to stop looping call, ignoring...")
ReconnectingClientFactory.clientConnectionFailed(self, connector,
reason)
示例13: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
self._failures += 1
dprint('connection failed ({}): {}'.format(
self._failures, reason. getErrorMessage()))
if self._listen or self._failures < 4:
ReconnectingClientFactory.clientConnectionFailed(
self, connector, reason)
else:
self.reactor.stop()
示例14: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
# Warn on first failure
if self.first_time == True:
Speaker.speak("no_server")
self.first_time = False
# Retry
self.resetDelay()
log.err("Connection failed. Reason:", reason.getErrorMessage())
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
示例15: clientConnectionFailed
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionFailed [as 别名]
def clientConnectionFailed(self, connector, reason):
"""
Notify the connectionPool that we're unable to connect
"""
if self._protocolInstance is not None:
self.connectionPool.clientBusy(self._protocolInstance)
ReconnectingClientFactory.clientConnectionFailed(
self,
connector,
reason)