毕业论文

打赏
当前位置: 毕业论文 > 计算机论文 >

HTTP服务器软件系统的设计与实现(10)

时间:2017-02-21 13:09来源:毕业论文
ApplicationSettings settings = sessionMgr.Info; string sessionKey = string.Empty; /// /// 现在我们检查,如果已经存在任何会话是SessionManager /// switch (settings.SessionType) { case


            
            ApplicationSettings settings = sessionMgr.Info;
            string sessionKey = string.Empty;
            ///
            /// 现在我们检查,如果已经存在任何会话是SessionManager
            ///
            switch (settings.SessionType)
            {
                case ApplicationSessionMode.SingletonSession:
                    ///
                    /// SingletonSession
                    ///
                    application = sessionMgr.GetOrCreateSingletonInstance();
                    return true;
                case ApplicationSessionMode.BrowserSession:
                    ///
                    /// 我们需要一个会话密钥identfy particolare浏览器
                    ///                    
                    sessionKey = e.Rawrequest.Connection.IP + "@" + e.Requests["User-Agent"];
                    break;
                case ApplicationSessionMode.IpSession:
                    ///
                    /// 我们需要一个会话密钥,identfy一个IP地址
                    ///                    
                    sessionKey = e.Rawrequest.Connection.IP.ToString();
                    break;
            }
           
            application = sessionMgr.GetOrCreateInstanceBySessionKey(sessionKey);

            return true;
        } HTTP服务器软件系统的设计与实现(10):http://www.751com.cn/jisuanji/lunwen_3170.html
------分隔线----------------------------
推荐内容