Notify the application that the connection has been closed.

        :param error: The exception which has caused the connection to
                      be closed.  If the connection has been closed
                      due to an EOF, pass ``None``.

def closed(self, error=None):
        """
        Notify the application that the connection has been closed.

        :param error: The exception which has caused the connection to
                      be closed.  If the connection has been closed
                      due to an EOF, pass ``None``.
        """

        if self._application:
            try:
                self._application.closed(error)
            except Exception:
                # Ignore exceptions from the notification
                pass