From f13e2f294a82afc5cd37e317a785861f82f773ce Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期二, 04 九月 2018 10:57:41 +0800
Subject: [PATCH] 1723  ios手机偶现断线后回到登录界面 界面交互失效

---
 Core/NetworkPackage/Socket/ClientSocketController.cs |   30 +++++++++++++++++++++++-------
 1 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/Core/NetworkPackage/Socket/ClientSocketController.cs b/Core/NetworkPackage/Socket/ClientSocketController.cs
index 4fe1a58..766d090 100644
--- a/Core/NetworkPackage/Socket/ClientSocketController.cs
+++ b/Core/NetworkPackage/Socket/ClientSocketController.cs
@@ -9,7 +9,8 @@
 public class ClientSocketController
 {
     Socket m_Socket;
-    public Socket socket {
+    public Socket socket
+    {
         get { return m_Socket; }
     }
 
@@ -114,16 +115,31 @@
     /// </summary>
     public void CloseConnect()
     {
-        isStopTreading = true;
-        if (m_packageThread != null)
+        try
         {
-            m_packageThread.Abort();
+            isStopTreading = true;
+            if (m_packageThread != null)
+            {
+                m_packageThread.Abort();
+            }
+        }
+        catch (System.Exception ex)
+        {
+            DebugEx.Log(ex);
         }
 
-        if (m_Socket != null && m_Socket.Connected)
+        try
         {
-            m_Socket.Shutdown(SocketShutdown.Both);
-            m_Socket.Close();
+            if (m_Socket != null && m_Socket.Connected)
+            {
+                m_Socket.Shutdown(SocketShutdown.Both);
+                m_Socket.Close();
+            }
+
+        }
+        catch (System.Exception ex)
+        {
+            DebugEx.Log(ex);
         }
 
         sendQueue.Clear();

--
Gitblit v1.8.0