Close the client and shut down the transport. Arguments have the same
        semantics as `self.flush()`.

def close(self, timeout=None, callback=None):
        """
        Close the client and shut down the transport. Arguments have the same
        semantics as `self.flush()`.
        """
        if self.transport is not None:
            self.flush(timeout=timeout, callback=callback)
            self.transport.kill()
            self.transport = None