Exemple #1
0
 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()
Exemple #2
0
	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
Exemple #3
0
 def clientConnectionLost(self, connector, reason):
     """
     Only necessary for as debugging aid - if we can somehow set parent's class noisy attribute then we can omit this method
     """
     if self.debug:
         print('IPAFactory connection lost:', reason.getErrorMessage())
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
Exemple #4
0
    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)
Exemple #5
0
	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
    def test_stopTryingDoesNotReconnect(self):
        """
        Calling stopTrying on a L{ReconnectingClientFactory} doesn't attempt a
        retry on any active connector.
        """
        class FactoryAwareFakeConnector(FakeConnector):
            attemptedRetry = False

            def stopConnecting(self):
                """
                Behave as though an ongoing connection attempt has now
                failed, and notify the factory of this.
                """
                f.clientConnectionFailed(self, None)

            def connect(self):
                """
                Record an attempt to reconnect, since this is what we
                are trying to avoid.
                """
                self.attemptedRetry = True

        f = ReconnectingClientFactory()
        f.clock = Clock()

        # simulate an active connection - stopConnecting on this connector should
        # be triggered when we call stopTrying
        f.connector = FactoryAwareFakeConnector()
        f.stopTrying()

        # make sure we never attempted to retry
        self.assertFalse(f.connector.attemptedRetry)
        self.assertFalse(f.clock.getDelayedCalls())
    def clientConnectionFailed(self, connector, reason):

        self.logger.warn('CmdrConnection failed: %s ' % (reason))

        self.activeConnection = None
        self.stateCallback(self)
        ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
Exemple #8
0
 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)
Exemple #9
0
 def clientConnectionFailed(self, connector, reason):
     log.msg('Connection failed. Reason:', reason)
     ReconnectingClientFactory.clientConnectionFailed(
         self, connector, reason)
Exemple #10
0
 def buildProtocol(self, addr): 
     self.lserver.LoginSrv=ReconnectingClientFactory.buildProtocol(self, addr)
Exemple #11
0
 def clientConnectionLost(self, connector, reason):
     logging.error( 'IntraFace - IntrafaceClient Lost connection.  Reason: %s' % (reason) )
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
Exemple #12
0
 def clientConnectionLost(self, connector, reason):
     self.logger.warning('connection lost:', reason.getErrorMessage())
     self.done.callback(None)
     ReconnectingClientFactory.clientConnectionLost(connector, reason)
Exemple #13
0
 def clientConnectionFailed(self, connector, reason):
     ReconnectingClientFactory.clientConnectionFailed(
         self, connector, reason)
Exemple #14
0
 def clientConnectionFailed(self, connector, reason):
     print 'Connection failed. Reason:', reason
     ReconnectingClientFactory.clientConnectionFailed(
         self, connector, reason)
Exemple #15
0
 def clientConnectionFailed(self, connector, reason):
     logging.info('Connection failed. Reason: %s', reason)
     ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
Exemple #16
0
 def clientConnectionFailed(self, connector, reason):
     if self.is_reconnecting:
         log.debug(reason)
         ReconnectingClientFactory.clientConnectionFailed(
             self, connector, reason)
Exemple #17
0
 def buildProtocol(self, addr):
     self.resetDelay()
     #if not self.is_reconnecting: raise
     return ReconnectingClientFactory.buildProtocol(self, addr)
 def clientConnectionLost(self, connector, reason):
     logger.debug('Feedback connection lost: %s',
                  reason.getErrorMessage())
     return ReconnectingClientFactory.clientConnectionLost(self,
                                                           connector,
                                                           reason)
Exemple #19
0
 def clientConnectionLost(self, connector, reason):
     if reactor.running:
         print('Lost connection.  Reason:', reason)
     ReconnectingClientFactory.clientConnectionLost(self, connector,
                                                    reason)
Exemple #20
0
 def clientConnectionLost(self, connector, reason):
     log.msg('Lost connection.  Reason:', reason)
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
Exemple #21
0
 def buildProtocol(self, *args, **kw):
     log.msg('Resetting reconnection delay')
     prot = ReconnectingClientFactory.buildProtocol(self, *args, **kw)
     log.msg("Listening for clients on ", (self.outAddress, self.outPort))
     self.resetDelay()
     return prot
Exemple #22
0
 def clientConnectionLost(self, connector, reason):
     print "*************************************"
     print "Connection Lost"
     print "reason:", reason
     print "*************************************"
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
Exemple #23
0
 def clientConnectionLost(self, connector, reason):
     self.registered = self.client.registered
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
Exemple #24
0
 def clientConnectionFailed(self, connector, reason):
     self.linfo('Connection to beah backend on %s failed: %s', connector.getDestination(), reason)
     self.backend.set_controller()
     if not self._done:
         ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
Exemple #25
0
 def clientConnectionFailed(self, conector, reason):
     if isinstance(reason, ConnectionLost):
         log.error('Connection failed: {}'.format(reason))
         ReconnectingClientFactory.clientConnectionFailed(
             self, conector, reason)
 def buildProtocol(self, addr):  # noqa
     self.resetDelay()
     return ReconnectingClientFactory.buildProtocol(self, addr)
Exemple #27
0
 def clientConnectionLost(self, connector, reason):
     print 'Lost connection.  Reason:', reason
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
Exemple #28
0
		def clientConnectionFailed(self, connector, reason):
			print 'Connection failed:', reason.getErrorMessage()
			# Try to reconnect
			print 'Trying to reconnect. Please wait...'
			ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
Exemple #29
0
 def clientConnectionFailed(self, connector, reason):
     self.logger.error('connection failed:', reason.getErrorMessage())
     self.done.errback(reason)
     ReconnectingClientFactory.clientConnectionFailed(connector, reason)
Exemple #30
0
		def clientConnectionLost(self, connector, reason):
			print 'Connection lost. Reason: {0}'.format(reason.getErrorMessage())
			# Try to reconnect
			print 'Trying to reconnect in 10 secs. Please wait...'
			ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
Exemple #31
0
 def clientConnectionLost(self, connector, reason):
     if DEBUG:
         print "Got clientConnectionLost for reason %s" % str(reason)
     self._handleConnectionError(reason, is_failed=False)
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
 def clientConnectionFailed(self, connector, reason):
     log.err("Failed to connect to realtime server at %s: %s" % (connector.getDestination().host, reason))
     ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
Exemple #33
0
 def clientConnectionFailed(self, connector, reason):
     logging.error( 'IntraFace - IntrafaceClient Connection failed.  Reason: %s' % (reason) )
     ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
Exemple #34
0
 def clientConnectionLost(self, connector, reason):
     self.logger.info("Connection with the broker lost: %s" % reason)
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
Exemple #35
0
 def clientConnectionLost(self, connector, reason):
     log.msg('Lost connection.  Reason:', reason)
     self.esme_callbacks.disconnect()
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
Exemple #36
0
 def clientConnectionFailed(self, connector, reason):
     self.logger.error("Connection with the broker failed: %s" % reason)
     ReconnectingClientFactory.clientConnectionFailed(
         self, connector, reason)
 def clientConnectionLost(self, connector, reason):
     log.err("Lost connection to realtime server at %s: %s" % (connector.getDestination().host, reason))
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
Exemple #38
0
 def clientConnectionFailed(self, connector, reason):
     log.error('connection failed: %s' % reason)
     self._paused = True
     ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)