/// <summary> /// end the session, and release all resources /// </summary> public void EndSession() { if (FAppDomainStatus == TSessionStatus.adsStopped) { TLogging.Log("EndSession (for client '" + this.ClientName + "'): Session has been stopped already!"); return; } TLogging.Log("EndSession (for client '" + this.ClientName + "'): Session is about to getting stopped!"); // TODORemoting // release all UIConnector objects TLogging.Log("EndSession (for client '" + this.ClientName + "'): Checking whether there is a HttpSession.Current object"); // clear the session object if (HttpContext.Current != null) { TLogging.Log("EndSession (for client '" + this.ClientName + "'): Clearing Session"); TSession.CloseSession(); } FClientDisconnectionFinishedTime = DateTime.Now; FAppDomainStatus = TSessionStatus.adsStopped; TLogging.LogAtLevel(1, "Session for client " + this.ClientName + " has been destroyed successfully!"); }
/// <summary> /// Initialises fields. /// /// </summary> /// <param name="AClientID">Server-assigned ID of the Client</param> /// <param name="AUserID">AUserID for which the AppDomain was created</param> /// <param name="AClientName">Server-assigned name of the Client</param> /// <param name="AClientComputerName">Computer name of the Client</param> /// <param name="AClientIPAddress">IP Address of the Client</param> /// <param name="AClientServerConnectionType">Type of the connection (eg. LAN, Remote)</param> /// <param name="AAppDomainName">Server-assigned name of the Client AppDomain /// </param> /// <returns>void</returns> public TConnectedClient(System.Int32 AClientID, String AUserID, String AClientName, String AClientComputerName, String AClientIPAddress, TClientServerConnectionType AClientServerConnectionType, String AAppDomainName) { FClientID = AClientID; FUserID = AUserID; FClientName = AClientName; FClientComputerName = AClientComputerName; FClientIPAddress = AClientIPAddress; FClientServerConnectionType = AClientServerConnectionType; FClientConnectionStartTime = DateTime.Now; FAppDomainName = AAppDomainName; FAppDomainStatus = TSessionStatus.adsConnectingLoginVerification; FDisconnectClientMonitor = new System.Object(); }
/// <summary> /// end the session, and release all resources /// </summary> public void EndSession() { if (FAppDomainStatus == TSessionStatus.adsStopped) { TLogging.Log("EndSession (for client '" + this.ClientName + "'): Session has been stopped already!"); return; } TLogging.Log("EndSession (for client '" + this.ClientName + "'): Session is about to getting stopped!"); // TODORemoting // release all UIConnector objects ClientStillAliveCheck.TClientStillAliveCheck.StopClientStillAliveCheckThread(); TLogging.Log("EndSession (for client '" + this.ClientName + "'): Checking whether there is a DB connection"); // close db connection if (DBAccess.GDBAccessObj != null) { TLogging.Log("EndSession (for client '" + this.ClientName + "'): Closing DB connection"); DBAccess.GDBAccessObj.CloseDBConnection(); } TLogging.Log("EndSession (for client '" + this.ClientName + "'): Checking whether there is a HttpSession.Current object"); // clear the session object if (HttpContext.Current != null) { TLogging.Log("EndSession (for client '" + this.ClientName + "'): Clearing Session"); TSession.Clear(); } FClientDisconnectionFinishedTime = DateTime.Now; FAppDomainStatus = TSessionStatus.adsStopped; TLogging.LogAtLevel(1, "Session for client " + this.ClientName + " has been destroyed successfully!"); }