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(localhost);
jmdns.register(serviceInfo);
However, I'm having trouble figuring out how to have my client retrieve the port number and IP address from the registered service and use this data to open a TCP connection. I've searched for examples of how to use JmDNS but to no avail. Can anyone here give me some basic examples? Or if anyone has any links to good resources/tutorials on JmDNS could they please provide them?
Note: JmDNS is a neccessity here, so I would appreciate answers pertaining only to JmDNS and not offering an alternative. Also, I have looked at the JmDNS API extensively, and still can't figure it out, so please don't post a link to the docs as a resource.
Thanks.