/**
   * Publish local node configuration via multicast
   *
   * @param serviceName name of service to be published. (e.g. release version for installation)
   *     instanceName name of instance which is publishing. (e.g. the local node id etc.) nodeConfig
   *     info to be published publishTime how long the info would be published
   */
  public void publish(
      String serviceName, String instanceName, Map<String, String> values, long publishTime)
      throws IOException {
    ServiceInfo info =
        ServiceInfo.create("_" + serviceName + "._tcp.local.", instanceName, 9999, 0, 0, values);
    this.jmdns.registerService(info);

    if (publishTime > 0) {
      sleep(publishTime);
      this.close();
    }
  }