| | |
| | | /// <summary> |
| | | /// 启动Socket接收和发送功能 |
| | | /// </summary> |
| | | public void Start () |
| | | public void Start (int port) |
| | | { |
| | | if (IsRunning ) { |
| | | return; |
| | |
| | | |
| | | asyncBeginReceive(); |
| | | |
| | | MainPage.Log ($"udp port : 6000"); |
| | | MainPage.Log ($"udp port : {port}"); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | 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) |
| | | { |
| | | DriverLayer.A_Protocal_Common.apc.ConvertReceiveData(bytes); |
| | | Control.Ins.ConvertReceiveData(bytes); |
| | | } |
| | | else if(((IPEndPoint)packet.RemoteEndPoint).Port == 6000)//处理bus 6000端口的数据 |
| | | { |