/// <summary> /// 释放所有用户 /// </summary> public void DropConnUserList() { lock (ConnUserList) { foreach (KeyValuePair <string, ConClient> user in ConnUserList) { user.Value.Sock.Close(); } ConnUserList.Clear(); } }
/// <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(); } }