I 'm unable to get txtrecord from ServiceEvent
in the function serviceAdded
(From JmDNS).
but I m able to get txtrecord from ServiceEvent
in the function serviceResolved
The serviceResolved
is executed at the start-up only 1 time and does not capte all services.
The serviceAdded
is execute each time it capte a new service. but when trying to access to txtrecord, I found nothing in txtrecord I found only the service name.
are there a solution to get all txtRecord each time I capte a new service ?
The service info associated with the event of serviceAdded
method does not include resolution information.
To get the full resolved information we need to call JmDNS.getServiceInfo(String, String, long)
public void serviceAdded(ServiceEvent event) {
ServiceInfo inf = event.getDNS().getServiceInfo(event.getType(), event.getName());
}
Reference: http://jmdns.sourceforge.net/apidocs/javax/jmdns/ServiceListener.html