From 5da99fed2eb0d08b6338064da5f998891252c7b8 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 18 五月 2020 16:39:59 +0800
Subject: [PATCH] 2020-05-18-2

---
 ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
index e53f180..89ec837 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
@@ -145,7 +145,11 @@
                                         FindGateWaySocket.BeginSend(new System.Net.IPEndPoint(broadcastIpAddress, 7624), broadBytes);
                                     }
                                 }
-                                catch { }
+                                catch
+                                {   
+                                    //鍏抽棴Socket,涓嬫鍙戦�佷細鑷姩杩炴帴
+                                    FindGateWaySocket.Stop();
+                                }
                                 System.Threading.Thread.Sleep(500);
                             }
                         })
@@ -258,10 +262,30 @@
                                             //鏍囪褰撳墠缃戝叧鏄富缃戝叧
                                             gateWay.getGatewayBaseInfo.IsMainGateWay = true;
                                         }
+                                    }
+
+                                    //娴嬭瘯鑳藉惁骞挎挱寰楀埌缃戝叧,閫氬父鎯呭喌涓嬩笉妫�娴�
+                                    if (Shared.Phone.UserCenter.UserCenterResourse.HideOption.CheckCanReceiveGateway == 1)
+                                    {
+                                        if (Shared.Phone.UserCenter.UserCenterResourse.DicReceiveGatewayTest.ContainsKey(id) == false)
+                                        {
+                                            if (gateWay == null)
+                                            {
+                                                Shared.Phone.UserCenter.UserCenterResourse.DicReceiveGatewayTest[id] = zbGateWay;
+                                            }
+                                            else
+                                            {
+                                                Shared.Phone.UserCenter.UserCenterResourse.DicReceiveGatewayTest[id] = gateWay;
+                                            }
+                                        }
                                     }
                                 }
                             }
-                            catch { }
+                            catch
+                            {
+                                //鍏抽棴Socket,涓嬫鍙戦�佷細鑷姩杩炴帴
+                                FindGateWaySocket.Stop();
+                            }
                         }
                         #endregion
                     }

--
Gitblit v1.8.0