CgwMonitorManage.Service.SessionManage.RemoveSessionBySessionId C# (CSharp) Method

RemoveSessionBySessionId() public method

删除会话
public RemoveSessionBySessionId ( string sessionId ) : SmcErr
sessionId string
return CgwMonitorManage.SmcError.SmcErr
        public SmcErr RemoveSessionBySessionId(string sessionId)
        {
            SmcErr err = new SmcErr();
            if (rwl.TryEnterWriteLock(CgwConst.ENTER_LOCK_WAIT_TIME))
            {
                try
                {
                    foreach (CgwSession cgwSession in sessionDict.Values)
                    {
                        if (cgwSession.SessionId == sessionId)
                        {
                            sessionDict.Remove(cgwSession.SessionGuid);
                            break;
                        }
                    }

                }
                finally
                {
                    rwl.ExitWriteLock();
                }
            }
            return err;
        }