Cgw.Service.SessionManage.GetSessionsCount C# (CSharp) Method

GetSessionsCount() public method

获取Session个数
public GetSessionsCount ( ) : int
return int
        public int GetSessionsCount()
        {
            int Count = 0;
            if (rwl.TryEnterReadLock(CgwConst.ENTER_LOCK_WAIT_TIME))
            {
                try
                {
                    if (sessionDict != null)
                    {
                        Count = sessionDict.Count;
                    }
                    else
                    {
                        Count = 0;
                    }
                }
                finally
                {
                    rwl.ExitReadLock();
                }
            }
            return Count;
        }