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)
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
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)
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
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')
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)
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)
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)
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)
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()
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)
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)
def clientConnectionLost(self, connector, reason): """ self.CONNECTION_INFO ok """ self.continueTrying = None log.msg('Lost connection. Reason: ', reason) ReconnectingClientFactory.clientConnectionLost(self,\ connector, reason)
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)
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
def clientConnectionLost(self, connector, reason): """ Called when the connection to the server is lost. Re-initialise per-connection variables and looping calls. """ ReconnectingClientFactory.clientConnectionLost( self, connector, reason) self.ackmap.stopChecker() self.init()
def test_parametrizedClock(self): """ The clock used by L{ReconnectingClientFactory} can be parametrized, so that one can cleanly test reconnections. """ clock = Clock() factory = ReconnectingClientFactory() factory.clock = clock factory.clientConnectionLost(FakeConnector(), None) self.assertEqual(len(clock.calls), 1)
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)
def clientConnectionLost(self, connector, reason): self._p.alive = False logger.info('Lost connection. Reason: {}'.format(reason)) self.attempt += 1 logger.info('Relogin attempt {}'.format(self.attempt)) self.relogin() ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
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.destinationDown(connector.factory.destination) args = dict(connector=connector, reason=reason) d = self.connectionLost self.connectionLost = Deferred() d.callback(args)
def clientConnectionLost(self, connector, reason): self._failures = 0 dprint('lost connection:', reason.getErrorMessage()) if self._listen: ReconnectingClientFactory.clientConnectionLost( self, connector, reason) else: try: self.reactor.stop() except: # ignore if no more running pass
def clientConnectionLost(self, connector, reason): d, self.on_disconnected = self.on_disconnected, None if self.continueTrying == 0: LOG.debug("Connection with server was closed.") # Invoke callback and tell that connection was closed cleanly if d: d.callback(None) else: LOG.error("Connection with server is lost: {0}".format( unicode(reason.value))) self._update_deferreds() # Invoke callback and tell that connection was lost if d: d.errback(reason) ReconnectingClientFactory.clientConnectionLost( self, connector, reason)
def clientConnectionLost(self, connector, reason): """ Notify the connectionPool that we've lost our connection. """ if self.connectionPool.shutdown_requested: # The reactor is stopping; don't reconnect return if self._protocolInstance is not None: self.connectionPool.clientBusy(self._protocolInstance) ReconnectingClientFactory.clientConnectionLost( self, connector, reason)
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)
def test_stopTryingWhenConnected(self): """ If a L{ReconnectingClientFactory} has C{stopTrying} called while it is connected, it does not subsequently attempt to reconnect if the connection is later lost. """ class NoConnectConnector(object): def stopConnecting(self): raise RuntimeError("Shouldn't be called, we're connected.") def connect(self): raise RuntimeError("Shouldn't be reconnecting.") c = ReconnectingClientFactory() c.protocol = Protocol # Let's pretend we've connected: c.buildProtocol(None) # Now we stop trying, then disconnect: c.stopTrying() c.clientConnectionLost(NoConnectConnector(), None) self.assertFalse(c.continueTrying)
def clientConnectionLost(self, connector, reason): """ Notify the pool that we've lost our connection. """ self.errors += 1 # Stop if self.errors >= self.errorsLimit: self.stopTrying() if self.continueTrying: 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 self.deferred: if self.protocolError is not None: self.deferred.errback(self.protocolError) else: 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 self.protocolError = None
def clientConnectionLost(self, connector, reason): """ Override client connection lost method Called when and established connection is lost @param connector: @param reason: @return: """ CONNECTION_INFO = misc.get_data_local_file(settingsFile='.settings') print CONNECTION_INFO['reconnection'] """ if self.CONNECTION_INFO['reconnection'] == 'yes': self.continueTrying = True elif self.CONNECTION_INFO['reconnection'] == 'no': self.continueTrying = None """ log.msg('Lost connection. Reason: ', reason) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): """Handle notification from the lower layers of connection loss. If we are shutting down, and twisted sends us the expected type of error, eat the error. Otherwise, log it and pass it along. Also, schedule notification of our subscribers at the next pass through the reactor. """ if self.dDown and reason.check(ConnectionDone): # We initiated the close, this is an expected close/lost log.debug('%r: Connection Closed:%r:%r', self, connector, reason) notifyReason = None # Not a failure else: log.debug('%r: clientConnectionLost:%r:%r', self, connector, reason) notifyReason = reason # Reset our proto so we don't try to send to a down connection self.proto = None # Schedule notification of subscribers self._get_clock().callLater(0, self._notify, False, notifyReason) # Call our superclass's method to handle reconnecting ReconnectingClientFactory.clientConnectionLost( self, connector, reason)
def clientConnectionFailed(self, connector, reason): print 'Connection failed:', reason.getErrorMessage() # Try to reconnect print 'Trying to reconnect. Please wait...' ReconnectingClientFactory.clientConnectionLost( self, connector, reason)
def clientConnectionLost(self, connector, reason): log.msg('Lost connection (%s). Reason: %s' % (self.variation, reason), logLevel=logging.INFO) ReconnectingClientFactory.clientConnectionLost(self, connector, reason) self.yelp()
def clientConnectionLost(self, connector, reason): irc_log.error('lost monitor IRC connection: %s', reason) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): ReconnectingClientFactory.clientConnectionLost(self, connector, reason) log.err('IRC connection lost: %s' % reason) self.retry(connector)
def clientConnectionLost(self, connector, reason): log("Lost Connection, reason: %s" % reason.getErrorMessage(), syslog.LOG_WARNING) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): logging.info('Lost connection. Reason: %s', reason) ReconnectingClientFactory.clientConnectionLost(self, connector, reason) dashboard_server.broadcast('q' + 'Connection to DMRlink Lost')
def clientConnectionLost(self, connector, reason): logging.debug( 'E4BLEClient - E4Client %s Lost connection. Reason: %s' % (self.client_id, reason)) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, unused_reason): self._controller_instance = None ReconnectingClientFactory.clientConnectionLost(self, connector, unused_reason)
def clientConnectionLost(self, connector, reason): if not self.hangup_ok: print("Connection to NCID Server lost\n (%s)\nretrying..." % reason.getErrorMessage()) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
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()
def clientConnectionLost(self, connector, reason): logger.error("Lost replication conn: %r", reason) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): if self.application.disconnecting: return ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): print("Connection lost - try to reconnect! " + str(reason)) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): logging.error('Proxy - Lost connection. Reason: %s' % (reason)) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): self._p.alive = False logger.info('Lost connection. Reason: {}'.format(reason)) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): global WEBSOCK_OPCODES logging.info('Lost connection. Reason: %s', reason) ReconnectingClientFactory.clientConnectionLost(self, connector, reason) dashboard_server.broadcast(WEBSOCK_OPCODES['QUIT'] + 'Connection to FNE Lost')
def clientConnectionLost(self, connector, reason): LOGERROR( '***Connection to Satoshi client LOST! Attempting to reconnect...' ) self.func_loseConnect() ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): print('Lost connection. Reason:', reason) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionFailed(self, connector, reason): log.msg('Connection failed (%s). Reason: %s' % (self.variation, reason), logLevel=logging.INFO) self.running = False ReconnectingClientFactory.clientConnectionLost(self, connector, reason) self.yelp()
def clientConnectionLost(self, connector: Connector, reason: Failure) -> None: logger.debug('Lost connection. Reason: {!r}'.format(reason)) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): ReconnectingClientFactory.clientConnectionLost(self, connector, reason) self.disconnected_callback()
def clientConnectionLost(self, connector, reason): out.info("Connection lost with reason: " + str(reason)) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): print 'clientConnectionLost:', connector.getDestination().host, 'reason:', reason ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): log.msg('Connection lost: %s' % (reason.value,)) self.window.clear() self.window.addstr(0, 0, 'Connection lost: %s' % (reason.value,)) self.window.refresh() ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): """ Called when the network connection to the APN feedback service has been lost. """ ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionFailed(self, connector, reason): """ The connection attempt to the APN feedback service has failed. """ log.err("Unable to connect to the APN feedback service") ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): if self.is_reconnecting: log.debug(reason) ReconnectingClientFactory.clientConnectionLost( self, connector, reason)
def clientConnectionLost(self, connector, reason): print('[Websocket] Lost connection. Reason: {}'.format(reason)) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionFailed(self, connector, reason): print("Connection failed - try to reconnect " + str(reason)) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionLost(self, connector, reason): print "Lost connection. Reason:", reason ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
def clientConnectionFailed(self, connector, reason): log.msg('APNSClientFactory clientConnectionFailed reason=%s' % reason) ReconnectingClientFactory.clientConnectionLost(self, connector, reason)