| | |
| | | { |
| | | public class Control_Udp |
| | | { |
| | | |
| | | public Control_Udp() |
| | | { |
| | | MainPage.Log($"control bus udp 被创建,时间:{DateTime.Now}"); |
| | | } |
| | | //public Control_Udp() |
| | | //{ |
| | | // MainPage.Log($"control bus udp 被创建,时间:{DateTime.Now}"); |
| | | //} |
| | | /// <summary> |
| | | /// 通讯端口 |
| | | /// </summary> |
| | |
| | | System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(managerSendCount)); |
| | | thread.IsBackground = true; |
| | | thread.Start(Packet); |
| | | |
| | | wait(); |
| | | //wait();不需要等待 |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"Send bus data error {ex.Message}"); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 本地udp控制A协议网关 |
| | | /// </summary> |
| | | public void SendLocalHdlLinkData(byte[] sendBytes) |
| | | { |
| | | Packet = new Packet(sendBytes, new System.Net.IPEndPoint(System.Net.IPAddress.Parse(Control.Ins.reportIp), 8585)); |
| | | Packet.HaveSendCount = 4;//ps:没有重发,后期有时间可以增加重发判断 |
| | | System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(managerSendCount)); |
| | | thread.IsBackground = true; |
| | | thread.Start(Packet); |
| | | //wait();不需要等待 |
| | | MainPage.Log($"发送Hdl-Link数据,IP:{Control.Ins.reportIp}:8585"); |
| | | } |
| | | |
| | | |
| | | } |