0

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.

Saby
  • 718
  • 9
  • 29

1 Answers1

0

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).

n0xew
  • 340
  • 3
  • 12
  • but this should not actually happen...have you found any solution for this ? – Saby Mar 03 '16 at 18:21
  • i think this is because when you desactivate wifi on android, they are no more wlan interfaces available, whereas on a computer they are still available; thus jmdns works with disabled wifi on a computer but not on android. This is what I concluded from my tests, I hope I'm wrong but it really looks like a design issue. – n0xew Mar 03 '16 at 19:02
  • No I think it is not correct, I think this has something to do with Multicast Socket.Actually while making a client-server communication system, in my server I used Multicast Socket to join the group and then create the jmdns to register the service but in my client I created the jmdns object without any issue(without turning on wifi and data) and I think jmdns should not be dependent on wlan only. I can provide other network interface also(like bt-pan). If you select the correct network interface, then it should not be a problem. – Saby Mar 04 '16 at 04:05