少年修仙传客户端代码仓库
client_Wu Xijin
2018-10-23 930ba67b9f3e4b099f20574319b5d04c2e429552
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();
@@ -313,7 +329,7 @@
        Array.Copy(vMsgBodyLength, 0, vTotal, 2, vMsgBodyLength.Length);
        Array.Copy(vBytes, 0, vTotal, 6, vBytes.Length);
        SendBytes(vBytes);
        SendBytes(vTotal);
    }
    /// <summary>