how to see properties of a JmDNS service in reciever side?
NickName:helene Ask DateTime:2011-09-16T21:42:37

how to see properties of a JmDNS service in reciever side?

One way of creating JmDNS services is :

 ServiceInfo.create(type, name, port, weight, priority, props);

where props is a Map which describes some propeties of the service. Does anybody have an example illustrating the use of theese properties, for instance how to use them in the reciever part. I've tried :

Hashtable<String,String> settings = new Hashtable<String,String>();
settings.put("host", "hhgh");
settings.put("web_port", "hdhr");
settings.put("secure_web_port", "dfhdyhdh");
ServiceInfo info = ServiceInfo.create("_workstation._tcp.local.", "service6", 80, 0, 0, true, settings);

but, then in a machine receiving this service, what can I do to see those properties?

I would apreciate any help...

Copyright Notice:Content Author:「helene」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/7445615/how-to-see-properties-of-a-jmdns-service-in-reciever-side

Answers
ranjeetcao 2015-03-17T05:47:15

ServiceInfo info = jmDNS.getServiceInfo(serviceEvent.getType(), serviceEvent.getName());\n\nEnumeration<String> ps = info.getPropertyNames();\n\nwhile (ps.hasMoreElements()) {\n String key = ps.nextElement();\n String value = info.getPropertyString(key);\n System.out.println(key + \" \" + value);\n}\n",


More about “how to see properties of a JmDNS service in reciever side?” related questions

how to see properties of a JmDNS service in reciever side?

One way of creating JmDNS services is : ServiceInfo.create(type, name, port, weight, priority, props); where props is a Map which describes some propeties of the service. Does anybody have an ex...

Show Detail

Jmdns not resloving service

I followed the example that comes with JmDNS. My code is as below! jmdns = JmDNS.create(); jmdns.addServiceListener("_nmx._tcp.local.",new ServiceListener() { @Overrid...

Show Detail

JmDNS service discovery in client-server

I'm trying to enable service discovery in my client-server application using JmDNS. I fully understand service registry on the server side, with code that resembles this: JmDNS jmdns = JmDNS.create(

Show Detail

Unregistering a zeroconf service using jmDNS

I'm tryng to make my Android app register a service via zeroconf while the app is active, and then unregister it after the app exits. In my onResume method I have the following code: // regis...

Show Detail

Not able to find JmDNS service in other machines

Using jmdns 3.4.1, I'm able to see the services advertised by the machines in the LAN, I can also create a service and register it, so that I can see it in my machine. However, when I create a new

Show Detail

JmDNS service not found in ZeroConf browser

I'm developing a web app in Java (with Spark) and I want it to use JmDNS to be able to find this server in my Android app. I was following steps from JmDNS page with service registration, and my code

Show Detail

Android JmDNS how to remove service

im currently writing an android app, which should keep track of other devices in the same wifi network using JmDNS. The discovery process works correctly, but i don't know how to keep track of other

Show Detail

Reregistering a service JMDNS

I have what I thought would be quite a simple problem. I'm trying to use JmDNS to broadcast a service which I've managed to do successfully, however when the app is paused, I want to unregister a

Show Detail

Samples with JmDNS

I've been able to get the samples that come with JmDNS to compile and run, however I can't get any of the classes to discover my services. I'm running a Windows environment with multiple PC's runn...

Show Detail

How to start 2 services at different ports using jmdns?

I need to start 2 services simultaneously (i.e airplay and airtunes) using jmdns. I'm able to start one service using jmdns but when I register 2 services simultaneously it gives me exception while

Show Detail