def METHOD_NAME(self, connection):
    if connection is not None:
        for channel in connection.channels.values():
            channel.connection = None
        try:
            os.close(connection.fileno())
        except (OSError, ValueError):
            pass
        connection.channels.clear()
        connection.callbacks.clear()
    self.client.drain_events = None
    self.client = None