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


Python ReconnectingClientFactory.clientConnectionLost方法代码示例

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


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

示例1: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
	def clientConnectionLost(self, connector, reason):
		"""
		Notify the pool that we've lost our connection.
		"""
		if self.protocolInstance is not None:
			if self.protocolInstance._lastreq and ((time() - self.protocolInstance._lastreq) >= 100):
				self.stopTrying()

		if self.continueTrying:
			ReconnectingClientFactory.clientConnectionLost(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
开发者ID:p0is0n,项目名称:txsphinx,代码行数:33,代码来源:client.py

示例2: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
    def clientConnectionLost(self, connector, reason):
        log.msg('MonitorClient connection lost, reason {}'.format(reason))

        if self.disconnected_cb:
            self.disconnected_cb()

        ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
开发者ID:hackerspace,项目名称:hacked_cnc,代码行数:9,代码来源:monitor.py

示例3: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
	def clientConnectionLost(self, connector, reason):
		global ncidsrv
		if not self.hangup_ok and config.plugins.NcidClient.connectionVerbose.value:
			Notifications.AddNotification(MessageBox, _("Connection to NCID Server lost\n (%s)\nretrying...") % reason.getErrorMessage(), type=MessageBox.TYPE_INFO, timeout=config.plugins.NcidClient.timeout.value)
		ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
		# config.plugins.NcidClient.enable.value = False
		ncidsrv = None
开发者ID:OpenVuPlus,项目名称:dvbapp-plugin,代码行数:9,代码来源:plugin.py

示例4: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
 def clientConnectionLost(self, connector, unused_reason):
     """Handle a lost connection"""
     if self.bot.quitting:
         log.msg('Factory shutting down, quitting')
         return
     RCF.clientConnectionLost(self, connector, unused_reason)
     log.msg('Factory reconnecting')
开发者ID:fbs,项目名称:fubot,代码行数:9,代码来源:factory.py

示例5: clienConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
    def clienConnectionLost(self, connector, reason):
        """ **********************************************************
        Called when a connection has been lost after it was connected

        @type reason: L{twisted.python.fialure.Failure}
        ******************************************************* """
        print 'Lost Connection. Reason:', reason
        ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
开发者ID:frellwan,项目名称:SciFy-Pi,代码行数:10,代码来源:ftpclient.py

示例6: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
	def clientConnectionLost(self, connector, reason):
		print "* Disconnected from server."
		if self.quitted:
			print "* Exiting main loop."
			reactor.stop()
		else:
			print "* Reconnecting..."
			ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
开发者ID:quytelda,项目名称:greenbot,代码行数:10,代码来源:greenbot.py

示例7: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
 def clientConnectionLost(self, connector, reason):
     print 'Lost connection.  Reason:', reason
     print "Wanttobelogged in %s %s" % \
         (self, self.session.want_to_be_logged_in)
     if not self.session.want_to_be_logged_in:
         self.stopTrying()
     else:
         RCF.clientConnectionLost(self, connector, reason)
开发者ID:smandy,项目名称:pyfix,代码行数:10,代码来源:ProtocolFactories.py

示例8: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
 def clientConnectionLost(self, connector, reason):
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
     log.clients(
         "%s::clientConnectionLost (%s:%d) %s" % (self, connector.host, connector.port, reason.getErrorMessage())
     )
     self.connectedProtocol = None
     self.connectionLost.callback(0)
     self.connectionLost = Deferred()
开发者ID:Cue,项目名称:graphite,代码行数:10,代码来源:client.py

示例9: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
    def clientConnectionLost(self, connector, reason):
        """ We are called when our connection is lost. Start trying to create a new connection. """

        self.logger.warn('CmdrConnection lost: %s ' % reason)
        
        self.activeConnection = None
        self.stateCallback(self)
        ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
开发者ID:Subaru-PFS,项目名称:tron_actorcore,代码行数:10,代码来源:CmdrConnection.py

示例10: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
 def clientConnectionLost(self, connector, reason):
     log.msg("Lost connection. Reason: %s" % reason, logLevel=INFO)
     if getattr(self, "restart", True):
         self.reset_protocol_for_login()
         ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
     else:
         log.msg("Done - no restart", logLevel=INFO)
         reactor.callWhenRunning(reactor.stop)
开发者ID:Watzmann,项目名称:TGSBot,代码行数:10,代码来源:tgsClient.py

示例11: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
    def clientConnectionLost(self, connector, reason):
        # Delete current connection
        self.active_protocol = None

        # Retry connection to the server
        log.err('Lost connection.  Reason: {0}'.format(reason.getErrorMessage()))
        if self.running_state == True:
            ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
开发者ID:gdumee,项目名称:LISA-CLIENT-Linux,代码行数:10,代码来源:service.py

示例12: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
 def clientConnectionLost(self, connector, reason):
     if not shuttingdown:
         logging.debug('Lost connection 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.clientConnectionLost(self, connector, reason)
开发者ID:lgleasain,项目名称:HoneyAlarmServer,代码行数:11,代码来源:alarmserver.py

示例13: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
    def clientConnectionLost(self, connector, reason):
        """
        self.CONNECTION_INFO ok
        """
        self.continueTrying = None

        log.msg('Lost connection. Reason: ', reason)
        ReconnectingClientFactory.clientConnectionLost(self,\
         connector, reason)
开发者ID:satnet-project,项目名称:uvigo-client,代码行数:11,代码来源:client_amp.py

示例14: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
 def clientConnectionLost(self, connector, reason):
     Logger.info(self.__class__.__name__ + ': Lost connection. ' + str(reason.value))
     if 'Connection was closed cleanly' in str(reason.value):
         Logger.debug(self.__class__.__name__ + ': Clean disconnect.')
         self.stopTrying()
     else:
         Logger.info(self.__class__.__name__ + ': Tracker not connected?')
          
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
     self.eyeTracker.connectedFlag = False
开发者ID:shearer12345,项目名称:mindCupola,代码行数:12,代码来源:eyeTracker.py

示例15: clientConnectionLost

# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import clientConnectionLost [as 别名]
    def clientConnectionLost(self, connector, reason):
        self.kato_client = None

        try:
            reason.trap(ConnectionDone)
            # clean connection close; do nothing
            print 'Connection closed. Reason:', reason
        except:
            # not a clean connection close; reconnect
            print 'Lost connection. Reason:', reason
            ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
开发者ID:EzanLTD,项目名称:katirc,代码行数:13,代码来源:kato.py


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