Saby
Saby

Reputation: 718

MulticastSocket Android related with Internet?

I am adding one network interface(eth) to a multicasting group for network broadcasting as I need to create jMDNS object. The ethernet interface is TCPIP for Bluetooth. I am facing one problem in which internet/Wifi needs to be active for creating the jMDNS object after joining the multicast group in a service publishing. In client side service discovery of jmdns, there is no need to create Multicast or to join Multicast Group.

So in case of publishing the service after creation of Multicast socket and joining the group, when I create jmdns object (without turning on Internet/Wifi) I am getting below exception

java.net.SocketException: setsockopt failed: ENODEV (No such device)

If i turn on Internet/Wifi on jmdns is created and every thing works fine.

So my question is why Internet/ Wifi needs to be turned on when I am explicitly using network interface for Bluetooth-Pan tethering ?

Is there any way to solve the problem ? or BT-Tethering always needs Internet connection ?

I am using java in Android framework as programming language.

Upvotes: 0

Views: 514

Answers (1)

n0xew
n0xew

Reputation: 340

I came accross a similar issue when trying to instantiate a jmdns on a device creating a hotspot. It looks like your device must be connected to a wifi to instantiate a jmdns(and thus not host of a hotspot).

Upvotes: 0

Related Questions