From dd922032a3301ae960f4968eaf33ca14768c0ed1 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期三, 11 九月 2024 11:42:03 +0800 Subject: [PATCH] V2.6.0金茂热水器,金茂光伏测试通过的版本 --- HDL_ON/DAL/DriverLayer/UdpSocket.cs | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/HDL_ON/DAL/DriverLayer/UdpSocket.cs b/HDL_ON/DAL/DriverLayer/UdpSocket.cs index c4b37fd..f6f9c40 100644 --- a/HDL_ON/DAL/DriverLayer/UdpSocket.cs +++ b/HDL_ON/DAL/DriverLayer/UdpSocket.cs @@ -43,8 +43,14 @@ if (Port == 0) return; - busSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); - busSocket.EnableBroadcast = true; + try + { + busSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + busSocket.EnableBroadcast = true; + }catch(Exception ex) + { + MainPage.Log("Socket 寮傚父 : " + ex.Message); + } try { busSocket.Bind(new IPEndPoint(IPAddress.Any, Port)); -- Gitblit v1.8.0