I found some examples for setting up a multicast socket server (receiving) in Android and I'm trying to add that to my project. My constructor code looks like this:
try
{
this.socket = new MulticastSocket (PORT);
socket.joinGroup (InetAddress.getByName (MULTICAST_ADDRESS));
}
catch (Exception ex)
{
Log.e (TAG, "Start up error: " + ex.getMessage());
ex.printStackTrace();
this.running = false;
}
However, for reasons I don't understand, every time the joinGroup() line is executed an exception is thrown. Strangely, the printStackTrace() line doesn't give me anything, but the Log.e() business gives me the following:
Multicast Server: Start up error: setsockopt failed: ENODEV (No such device)
I have added the necessary permissions to my code (CHANGE_WIFI_MULTICAST_STATE, ACCESS_WIFI_STATE, & INTERNET), and I have acquired a Multicast lock as well.
Any suggestions at what's missing here?