wei
2020-11-28 d9a936f7ec50dc04c8786b9a661a0890ade52262
HDL_ON/DAL/DriverLayer/UdpSocket.cs
@@ -29,23 +29,24 @@
        {
         if (IsRunning)
         {
            if (port == _port)
            {
               return;
                if (port == _port)
                {
                    return;
                }
                else
                {
               busSocket.Close();
                    busSocket.Close();
                }
         }
         _port = port;
            }
            _port = port;
            busSocket = new Socket (AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            busSocket.EnableBroadcast = true;
            try {
                busSocket.Bind (new IPEndPoint (IPAddress.Any, port));
                //busSocket.Bind (new IPEndPoint (IPAddress.Any, 6000));
                busSocket.Bind(new IPEndPoint(IPAddress.Any, port));
            busSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse("239.0.168.188")));
                busSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse("239.0.168.188")));
         }
         catch{
                busSocket = null;