From b2f25bfca6471fe3bfa041da8e4a1d01fd00f6ed Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期一, 23 九月 2024 16:54:12 +0800 Subject: [PATCH] Update JLCountrycode.cs --- 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