Exemple #1
0
        /// <summary>
        /// 释放所有用户
        /// </summary>
        public void DropConnUserList()
        {
            lock (ConnUserList)
            {
                foreach (KeyValuePair <string, ConClient> user in ConnUserList)
                {
                    user.Value.Sock.Close();
                }

                ConnUserList.Clear();
            }
        }
Exemple #2
0
        /// <summary>
        /// 释放所有用户
        /// </summary>
        public void DropConnUserList()
        {
            lock (ConnUserList)
            {
                foreach (var user in ConnUserList)
                {
                    if (user.Value.IsConnect && user.Value.Client != null)
                    {
                        user.Value.Client.Sock.Close();
                    }
                }

                ConnUserList.Clear();
            }
        }