code: public static boolean isConnectionClosure(ShutdownSignalException e) {
      return e instanceof AlreadyClosedException ? e.getReference() instanceof Connection
          : e.isHardError();
    }
docs: Reliably returns whether the shutdown signal represents a connection closure.