public void BeginSession(ServerSessionBase session) { pool.Add(session); session.ReleaseEvent += Session_OnReleased; OnSessionStarted(session); }
public bool Authorize(HttpListenerResponse response, HttpUserCredentials user) { if (!Restricted) { return(true); } var _user = Authorization.Authorize(user); if (_user == null) { return(false); } _user.Lifespan = TimeSpan.FromMinutes(60); _user.Restart(); userTokens.Add(_user); var cookie = new Cookie(CookieName, _user.SessionId) { Expires = DateTime.Now.AddYears(1), }; response.SetCookie(cookie); return(true); }
public void BeginSession(AgentSessionBase session) { pool.Add(session); session.ReleaseEvent += Session_OnReleased; OnSessionChanged(session); Log.Info($"Started Session '{session.SessionId}'."); }
/// <summary> /// 向引用池中追加指定数量的引用 /// </summary> /// <param name="referenceType">引用类型</param> /// <param name="count">追加数量</param> public void Add(Type referenceType, int count) { ReferencePool.Add(referenceType, count); }
/// <summary> /// 向引用池中追加指定数量的引用 /// </summary> /// <typeparam name="T">引用类型</typeparam> /// <param name="count">追加数量</param> public void Add <T>(int count) where T : class, IReference, new() { ReferencePool.Add <T>(count); }
public void Add(TaskRunner runner) { pool.Add(runner); }
public void BeginSession(IAgentSession session) { pool.Add(session); Log.Info($"Started Session '{session.SessionId}'."); }