UDP multicast group on Windows Phone 8

Solution 1:

I notice you use the loopback. I think it means that when you send a message from your client you will receive the message you sent also. This means your receive handler will fire. It has the effect of clearing the receive buffer in a seemingly unthreadsafe fashion. Try putting some try catch in your receive method and see if anything untoward is happening but you might instead just not use the shared receive buffer in any case.

Solution 2:

Have you ever tried joining another multicast group? Because 224.0.1.1 seems to be in use as of IANA assignments. You find all of the here.

Maybe on Windows Phone 8 some service is tighter bound to listen to messages coming in (e.g. a network service that is running in kernel mode) and they are never forwarded to you.

Solution 3:

UDP multicast works pretty strangely under windows phone 7 from my experience so you should checkout the same for windows phone 8.

Here is my experience:

  1. check what is officially supported, for instance under Windows Phone OS 7.1 (last OS I tried before switching), TCP unicast, UDP unicast, and UDP multicast clients are supported.
  2. some versions of Windows phone permit to receive a UDP session only if the client first opened it and the session is received within no more than 10 seconds, this seems like some sort of security thing on Windows Phone.
  3. try with different addresses: multicast addresses in the range from 224.0.0.0 to 224.0.0.255 inclusive are “well-known” reserved multicast addresses.
  4. Check both in the virtual machine and in a real phone device, the behaviour may differ.