You must be logged in to reply.

Page 2 of 2 out of 17 messages.

[Solved] EMX with 4.2.9.0 UDP Broadcast Issue

Reply #10 — Posted 2 years ago
dont know but try your code in emulator Wink
if it works its ghi and not netmf related
@andre.m - You must have read my mind. I just gave the emulator a try and it's working fine in there :/ Just had to remove some of the GHI specific lines and change the local endpoint. Below is what I ran in the emulator.

public class Program
    {
        public static void Main()
        {
            //string broadcastIP = "255.255.255.255";
            string broadcastIP = "100.100.255.255";
             
            // Set up UDP endpoint
            EndPoint localEndPoint = new IPEndPoint(IPAddress.Parse("100.100.100.254"), 28598);
            EndPoint remoteEndPoint = new IPEndPoint(IPAddress.Parse(broadcastIP), 28599);
            Socket serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            serverSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
            serverSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true);
            serverSocket.Bind(localEndPoint);
            
            byte[] sendData = new byte[] { 0x1E, 0x10, 0xFF, 0xFF };

            for (; ; )
            {
                serverSocket.SendTo(sendData, remoteEndPoint);
                Thread.Sleep(1000);
            }
        }
    }
Reply #12 — Posted 2 years ago
now we know its definitively up to ghi to solve the broadcast issue
is not bad because we have our fix a bit earlier
Using ostinato, I injected an ARP reply for 100.100.255.255 to resolve to FF:FF:FF:FF:FF:FF and it started working properly. Obviously once this ARP record expires or the device is rebooted, it will stop working.

-Dan Powers
Reply #14 — Posted 2 years ago
by Gus
This is the chosen answer.
andre.m says:

now we know its definitively up to ghi to solve the broadcast issue
is not bad because we have our fix a bit earlier


Not exactly in this case as the TCP/IP stack used in NETMF is not used by the emulator. We will run few test on multiple devices to see if it is related to a single device or it is on all devices. My guess it will be on all devices and will report to Microsoft if that is the case.
@Gus - Thanks Gus! I'll just work around the issue for now by using 255.255.255.255. It should work for my application for the time being.

Thanks guys,
Dan Powers
@Gus - looks like the issue is resolved in 4.2.10.0. Marking it as answered.

Page 2 of 2 out of 17 messages.

You must be logged in to reply.