Exemplo n.º 1
0
        public void Close()
        {
            Connected = false;

            if (m_Kcp != null)
            {
                m_Kcp.Dispose();
                m_Kcp = null;
            }


            if (m_ThreadRecv != null)
            {
                m_ThreadRecv.Interrupt();
                m_ThreadRecv = null;
            }

            if (m_SystemSocket != null)
            {
                try
                {
                    m_SystemSocket.Shutdown(SocketShutdown.Both);
                }
                catch (Exception e)
                {
                    Debuger.LogWarning(e.Message + e.StackTrace);
                }

                m_SystemSocket.Close();
                m_SystemSocket = null;
            }
        }
Exemplo n.º 2
0
        public void Close()
        {
            this.Log();
            this.m_actived = 0;

            if (m_Kcp != null)
            {
                m_Kcp.Dispose();
                m_Kcp = null;
            }


            if (m_ThreadRecv != null)
            {
                m_ThreadRecv.Interrupt();
                m_ThreadRecv = null;
            }

            if (m_socket != null)
            {
                try { m_socket.Shutdown(SocketShutdown.Both); }
                catch (Exception ex) { this.LogWarning(ex.Message); }

                m_socket.Close();
                m_socket = null;
            }
        }
Exemplo n.º 3
0
 override public void Dispose()
 {
     if (kcpObject != null)
     {
         kcpObject.Dispose();
         kcpObject = null;
     }
     base.Dispose();
 }
Exemplo n.º 4
0
 public void Clean()
 {
     Debuger.Log();
     if (m_Kcp != null)
     {
         m_Kcp.Dispose();
         m_Kcp = null;
     }
     m_RecvListener = null;
     Close();
 }
Exemplo n.º 5
0
 public void Clean()
 {
     kcp?.Dispose();
     kcp            = null;
     recvListener   = null;
     sendBufferTemp = null;
     recvBufferTemp = null;
     tempSendData   = null;
     recvBuffQueue.Clear();
     recvBuffQueue = null;
     Close();
 }
Exemplo n.º 6
0
 public void Close()
 {
     Connected = false;
     kcp?.Dispose();
     kcp = null;
     threadRecv?.Interrupt();
     threadRecv = null;
     if (currentSocket != null)
     {
         try
         {
             currentSocket.Shutdown(SocketShutdown.Both);
         }
         catch (Exception e)
         {
             Debuger.LogWarning(e.Message + e.StackTrace);
         }
         currentSocket.Close();
         currentSocket = null;
     }
 }
Exemplo n.º 7
0
 public void Clean()
 {
     kcp?.Dispose();
     kcp = null;
 }