Exemplo n.º 1
0
 public void Close()
 {
     if (!isUse)
     {
         return;
     }
     if (player != null)
     {
         player.Logout();
         return;
     }
     Console.WriteLine("[断开连接]" + GetAddr());
     socket.Shutdown(SocketShutdown.Both);
     socket.Close();
     isUse = false;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Close the conn.
        /// </summary>
        public void Close()
        {
            if (isUse == false)
            {
                return;
            }
            if (player != null)
            {
                player.Logout();
                return;
            }

            Console.WriteLine("[Conn.Close] Disconnect with " + GetAddress());
            socket.Shutdown(SocketShutdown.Both);
            socket.Close();
            isUse = false;
        }