I'm trying to send out a multicast packet then receive the response that comes back (there should only be one response.) I can send the packet, and wireshark shows the reply but my program never receives it. I've tried a few different things but this is the current state of my non-functioning code.
IPEndPoint epReceive = new IPEndPoint(IPAddress.Any, 5355);
IPEndPoint epSend = new IPEndPoint(IPAddress.Parse("224.0.0.252"), 5355);
UdpClient sendClient = new UdpClient();
sendClient.ExclusiveAddressUse = false;
sendClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
sendClient.Client.Bind(epReceive);
sendClient.Send(packet, packetLength, epSend);
byte[] buffer = sendClient.Receive(ref epReceive);
sendClient.Close();
This code just hangs on the sendClient.Receive() line. I realise this code is currently blocking and could/should be threaded, but for the purposes it's being used for it's not a concern.