def abort(self):
        """
        Close the connection and cause all outstanding L{request} L{Deferred}s
        to fire with an error.
        """
        if self._state == "CONNECTION_LOST":
            return succeed(None)
        self.transport.loseConnection()
        self._state = 'ABORTING'
        d = Deferred()
        self._abortDeferreds.append(d)
        return d

        Close the connection and cause all outstanding L{request} L{Deferred}s
        to fire with an error.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/_newclient.py