wxr
2024-01-08 51f5f7a47d394163dccf2441cd04c2a19ceeda34
HDL_ON/DAL/DriverLayer/UdpSocket.cs
@@ -45,13 +45,15 @@
            busSocket = new Socket (AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            busSocket.EnableBroadcast = true;
            try {
            try
            {
            busSocket.Bind(new IPEndPoint(IPAddress.Any, Port));
            busSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse("239.0.168.188")));
            relinkCount = 0;
         }
         catch (Exception ex){
            catch (Exception ex)
            {
            MainPage.Log ($"udp port bind error : {ex.Message}");
            busSocket = null;
@@ -111,11 +113,13 @@
            return;
            }
            try {
            try
            {
                Packet packet = new Packet ();
                busSocket.BeginReceiveFrom (packet.Bytes, 0, packet.Bytes.Length, SocketFlags.None, ref packet.RemoteEndPoint, new AsyncCallback (asyncEndReceive), packet);
            } 
            catch (Exception e) {
            catch (Exception e)
            {
                System.Threading.Thread.Sleep (1);
                Console.WriteLine("asyncBeginReceive " + relinkCount   );
            if (relinkCount == 0)
@@ -209,7 +213,8 @@
         {
            int bytesSent = busSocket.EndSendTo(iar);
         }
         catch {
            catch
            {
            
            }
      }