wei
2020-11-27 1293fea19c6a2b558986856e301d5218c1979692
HDL_ON/DAL/DriverLayer/UdpSocket.cs
@@ -1,9 +1,8 @@
using System;
using System.Net.Sockets;
using System.Net;
using Newtonsoft.Json.Linq;
namespace HDL_ON
namespace HDL_ON.DriverLayer
{
   public class UdpSocket
   {
@@ -26,7 +25,7 @@
      /// <summary>
      /// 启动Socket接收和发送功能
      /// </summary>
      public void Start ()
      public void Start (int port)
        {
            if (IsRunning ) {
                return;
@@ -46,7 +45,7 @@
            asyncBeginReceive();
            MainPage.Log ($"udp port : 6000");
            MainPage.Log ($"udp port : {port}");
        }
      /// <summary>
@@ -120,10 +119,11 @@
            packet.Bytes = new byte[len];
            Array.Copy(bytes, 0, packet.Bytes, 0, packet.Bytes.Length);
            MainPage.Log($"接收IP{packet.RemoteEndPoint}数据");
            //mqtt连接数据读取  A协议网络设备信息读取回复 处理
            if (((IPEndPoint)packet.RemoteEndPoint).Port == 8585)
            {
               Common.A_Protocal_Common.apc.ConvertReceiveData(bytes);
               Control.Ins.ConvertReceiveData(bytes);
            }
            else if(((IPEndPoint)packet.RemoteEndPoint).Port == 6000)//处理bus 6000端口的数据
            {