@Override
  public void serviceAdded(ServiceEvent serviceEvent) {
    String type = serviceEvent.getType();
    String name = serviceEvent.getName();

    try (JmDNS dns = serviceEvent.getDNS()) {
      dns.requestServiceInfo(type, name);
      ServiceInfo serviceInfo = dns.getServiceInfo(type, name);
      if (serviceInfo != null) {
        dns.requestServiceInfo(type, name);
      }
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
 public void serviceRemoved(ServiceEvent event) {
   removeService(event.getDNS(), event.getType(), event.getName());
 }
Example #3
0
 @Override
 public void serviceAdded(ServiceEvent event) {
   Log.i(TAG, "Service added: " + event.getType() + "\n Info: " + event.getInfo());
   // Для вызова serviceResolved(...)
   event.getDNS().requestServiceInfo(event.getType(), event.getName(), 100);
 }
 public void serviceAdded(ServiceEvent event) {
   addService(event.getDNS(), event.getType(), event.getName());
 }