/**
   * Constructs a <CODE>DiscoveryResponder</CODE>.
   *
   * <p>This constructor initialize multicast group and a multicast port. No check is done on the
   * parameter values. Check will be performed by the start method.
   *
   * @param multicastGroup The multicast group name.
   * @param multicastPort The multicast port number.
   * @param inf the interface used by a MulticastSocket.
   * @param local the local host address used to answer a request.
   */
  public DiscoveryResponder(
      String multicastGroup, int multicastPort, InetAddress inf, String local) {
    // ----------------
    // initialization
    // ----------------
    this.multicastGroup = multicastGroup;
    this.multicastPort = multicastPort;

    if (inf != null && !org.jocean.jdmk.internal.Useful.isLocalHost(inf)) {

      throw new IllegalArgumentException(
          "The user specified multi cast group is not a local interface: " + inf);
    }
    usrInet = inf;

    if (local != null && !org.jocean.jdmk.internal.Useful.isLocalHost(local)) {

      throw new IllegalArgumentException("The user specified local host is not a local: " + local);
    }
    this.local = local;

    if (logger.finerOn()) {
      logger.finer("constructor ", "Set group to '" + multicastGroup + "'");
      logger.finer("constructor ", "Set port  to '" + multicastPort + "'");

      if (inf != null) {
        logger.finer("constructor ", "Set interface  to '" + inf + "'");
      }

      if (local != null) {
        logger.finer("constructor ", "Set the local host to '" + local + "'");
      }
    }
  }