EMX not receiving broadcast packets (4.2 QFE2 4.2.5.0)

Hi All,

When I was running NETMF 4.1 on my EMX devices I used to be able to send broadcast packets over UDP and receive them on all other networked EMX nodes.
I have recently upgrated all EMX’s to 4.2 QFE2 using GHI’s update application.

I’m now unable to receive packets on any of the devices, including the device which sends the packet.
My code has not changed between the upgrade.

I know the broadcast packet is being sent, I can see the packet in wireshark.

Any ideas?? Has something changed in 4.2?

Below code for ref:

#region Using Directives

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;

 #endregion

namespace Intellitouch.IO.Sockets
{

    #region Public Delegates

    public delegate void BroadcastPacketReceivedHandler(object sender, byte[] payload);

    #endregion

    public class NetworkSocketBroadcastServer
    {

        #region Public Events

        public event BroadcastPacketReceivedHandler BroadcastPacketReceived;

        #endregion

        #region Private Members

        private readonly Socket _serverSocket;
        private readonly Socket _clientSocket;
        private readonly Thread _tListener;
        private EndPoint _serverEndpoint;
        private EndPoint _clientEndpoint;

        #endregion

        #region Construct

        public NetworkSocketBroadcastServer(int port, int sendTimeout)
        {
            _serverEndpoint = new IPEndPoint(IPAddress.Any, port);
            _clientEndpoint = new IPEndPoint(new IPAddress(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF }), port);

            _serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp) { SendTimeout = sendTimeout };
            _clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp) { SendTimeout = sendTimeout };

            _serverSocket.Bind(_serverEndpoint);
            _clientSocket.Connect(_clientEndpoint);

            _tListener = new Thread(ListenAndAccept);
            _tListener.Start();
        }

        #endregion

        #region Public Methods

        public bool Send(byte[] payload)
        {
            try
            {
                _clientSocket.Send(payload);
            }
            catch (Exception)
            {
                return false;
            }
            return true;
        }

        #endregion

        #region Private Methods

        private void ListenAndAccept()
        {
            while (true)
            {
                //--- NEVER GETS HERE WHEN BROADCAST PACKET SENT---
                if (!_serverSocket.Poll(-1, SelectMode.SelectRead)) continue;
                var buffer = new byte[_serverSocket.Available];
                _serverSocket.ReceiveFrom(buffer, ref _serverEndpoint);

                if (BroadcastPacketReceived != null)
                    BroadcastPacketReceived(this, buffer);
            }
        }

        #endregion

    }
}




Andre,

That has to be the fastest reply ever (under 2 minutes!!)
Thank you very much for the info.

Regards,
James

Superb.

There are a few issues on that link which I can see manifesting here also, so looking forward to the next release.
The UDP issues will also explain why my SNTP client is bombing…

Cheers,
James