def clientConnectionFailed(self, connector, reason): addr = connector.getDestination() log.warn("Connecting to %s:%s failed: %s" % (addr.host, addr.port, reason.value), prefix=self.logstr) self._connection = None self._reconnect()
def processEnded(self, reason): if isinstance(reason.value, error.ProcessDone): log.debug("Process ended", prefix=self._pid) reason = None else: log.warn(reason, prefix=self._pid) deferred = self._deferred self._deferred = None deferred.callback(reason)
def clientConnectionLost(self, connector, reason): addr = connector.getDestination() if isinstance(reason.value, error.ConnectionDone): log.info("Connection to %s:%s closed" % (addr.host, addr.port)) else: log.warn("Connection to %s:%s lost: %s" % (addr.host, addr.port, reason.value), prefix=self.logstr) self._connection = None self._reconnect()
def connect(self): if not self._path: return try: os.unlink(self._path) log.warn("Removed an old socket: %s" % self._path) except OSError: pass self._socket = reactor.listenUNIX(self._path, self)
def sendLine(self, line): if line.startswith("error"): log.warn(line, prefix=self._pid) else: log.trace(line, prefix=self._pid)
def errReceived(self, data): log.warn(data.strip(), prefix=self._pid)
def _force_disconnect(self): if self._connection: log.warn("Killing connection...") self._force_disconnect_timer = None self._connection.transport.loseConnection()