public void Close()
        {
            mTcp.Close();


            List <Session> list = new List <Session>(mSessionList);

            foreach (Session c in list)
            {
                c.Disconnect();
            }
            mSessionList.Clear();
            list.Clear();
        }
示例#2
0
 /// <summary>
 /// 断开连接
 /// </summary>
 public void Disconnect()
 {
     if (mTcp != null)
     {
         mTcp.Close();
     }
     if (mUdp != null)
     {
         mUdp.Close();
     }
     if (mKcp != null)
     {
         mKcp.Close();
     }
 }
示例#3
0
 public void Disconnect()
 {
     if (mTcp != null)
     {
         mTcp.Close();
     }
     //if (mUdp != null)
     //{
     //    mUdp.Close();
     //}
     //if(mKcp!=null)
     //{
     //    mKcp.Close();
     //}
 }