def stopTrying(self):
        """
        Put a stop to any attempt to reconnect in progress.
        """
        # ??? Is this function really stopFactory?
        if self._callID:
            self._callID.cancel()
            self._callID = None
        self.continueTrying = 0
        if self.connector:
            try:
                self.connector.stopConnecting()
            except error.NotConnectingError:
                pass

        Put a stop to any attempt to reconnect in progress.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/protocol.py