From ee17f50f8953fad307c5edb380b21d58bcc347ab Mon Sep 17 00:00:00 2001
From: nigel wei <nigelwei@nigeldeMacBook-Air.local>
Date: 星期日, 01 九月 2024 22:28:44 +0800
Subject: [PATCH] Update HDL_APP_Project.sln

---
 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