Question

I am using Java 6 update 14 for development and NetBeans 6.7. I am creating a sample client to detect particular type of service using Bonjour.

I face a certain challenge where I want to get the IP address of the device. But the ResolveListener.serviceResolved(...) function, provides only Hostname and Port. The FullName also does not contain IP information of the device. Is it possible to obtain the IP address of the device using Bonjour SDK? If yes, how?

Thanks.

Was it helpful?

Solution

Use the standard Java InetAddress class to resolve the hostname to an IP address. ZeroConf (Bonjour being Apple's implementation) quite reasonably abstracts service-hosts by hostname.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top