/// <summary> /// Gets the DataLog Server Hostname for the given sessionId. /// If none is found, returns empty string. /// </summary> /// <param name="sessionId">The Session Id.</param> /// <returns>The DataLog Server Hostname.</returns> protected string GetLogServiceHost(string sessionId) { try { RegisteredSessionInfo sessionInfo = RegisteredSessions[sessionId]; sessionInfo.LastUsed = DateTime.Now; return(sessionInfo.LogServiceHostName); } catch (Exception) { return(GlobalSettings.WcfHosts[WcfService.DataLog]); } }
private bool IsSessionInactive(RegisteredSessionInfo sessionInfo) { // If it has been X hours or more since this sessionInfo was referenced, consider the session inactive. return((DateTime.Now - sessionInfo.LastUsed).TotalHours >= _expirationIntervalHours); }