locked
UDP Client that Sends Multicast and Receives Unicast RRS feed

  • Question

  • I would like to communicate with a device that is listening on a UDP multicast group. I've gone through the documentation and I've tried using the UdpAnySourceMulticastChannel in the samples. The problem comes about when the device responds back to me; it uses a unicast message (addressed to my IP; not the group). The UdpAnySourceMulticastChannel sample can only receive multicast responses addressed to the group, it seems. I'm seeing the traffic from the other devices that are sending messages to the group, but I never get my unicast message back.

    I've read on the forums that you can't receive a packet unless you send one, first -- because the phone is only a "client" and not a "server" -- though that line is blurred with UDP. Is this true for the operating mode too? (i.e. you can't receive a unicast packet unless you send one first)

    Any hints about how to send multicast, but receive unicast would be fantastic. Thanks!
    Saturday, January 14, 2012 4:51 AM

Answers

  • By the way, I solved my problem. I had to use a raw socket. In the Completed event, after the send, I had to change the endpoint to one that listed to IPAddress.Any and used the appropriate port.

    Thanks.
    Sunday, January 15, 2012 10:39 PM