/// <summary> /// Constructor for passing in parameters. /// </summary> public TClientStillAliveCheck(TConnectedClient AConnectedClient, TClientServerConnectionType AClientServerConnectionType, TDelegateTearDownAppDomain ATearDownAppDomain, string AUser = "") { FClientObject = AConnectedClient; ClientName = FClientObject.ClientName; Int32 ClientStillAliveTimeout; // Note: calls to TLogging here only go to the console. The log file doesn't get initialised in TLogging until TClientDomainManager.EstablishDBConnection() TLogging.LogAtLevel(10, "TClientStillAliveCheck (for ClientName '" + ClientName + "'') created"); // Determine timeout limit (different for Clients connected via LAN or Remote) if (AClientServerConnectionType == TClientServerConnectionType.csctRemote) { ClientStillAliveTimeout = TSrvSetting.ClientKeepAliveTimeoutAfterXSecondsRemote; } else if (AClientServerConnectionType == TClientServerConnectionType.csctLAN) { ClientStillAliveTimeout = TSrvSetting.ClientKeepAliveTimeoutAfterXSecondsLAN; } else { ClientStillAliveTimeout = TSrvSetting.ClientKeepAliveTimeoutAfterXSecondsLAN; } UClientStillAliveTimeout = ClientStillAliveTimeout; UClientStillAliveCheckInterval = TSrvSetting.ClientKeepAliveCheckIntervalInSeconds; UTearDownAppDomain = ATearDownAppDomain; // UTearDownAppDomainToken = ATearDownAppDomainToken; TLogging.LogAtLevel(2, "ClientStillAliveTimeout: " + ClientStillAliveTimeout.ToString() + "; " + "ClientKeepAliveCheckIntervalInSeconds: " + UClientStillAliveCheckInterval.ToString()); // Start ClientStillAliveCheckThread UKeepServerAliveCheck = true; UClientStillAliveCheckThread = new Thread(new ThreadStart(ClientStillAliveCheckThread)); UClientStillAliveCheckThread.Name = "ClientStillAliveCheckThread" + Guid.NewGuid().ToString(); UClientStillAliveCheckThread.IsBackground = true; UClientStillAliveCheckThread.Start(); TLogging.LogAtLevel(10, "TClientStillAliveCheck (for ClientName '" + ClientName + "'): started " + UClientStillAliveCheckThread.Name); }
/// <summary> /// Constructor for passing in parameters. /// </summary> public TClientStillAliveCheck(TConnectedClient AConnectedClient, TClientServerConnectionType AClientServerConnectionType, TDelegateTearDownAppDomain ATearDownAppDomain) { FClientObject = AConnectedClient; ClientName = FClientObject.ClientName; Int32 ClientStillAliveTimeout; TLogging.LogAtLevel(2, "TClientStillAliveCheck (for ClientName '" + ClientName + "'') created"); // Determine timeout limit (different for Clients connected via LAN or Remote) if (AClientServerConnectionType == TClientServerConnectionType.csctRemote) { ClientStillAliveTimeout = TSrvSetting.ClientKeepAliveTimeoutAfterXSecondsRemote; } else if (AClientServerConnectionType == TClientServerConnectionType.csctLAN) { ClientStillAliveTimeout = TSrvSetting.ClientKeepAliveTimeoutAfterXSecondsLAN; } else { ClientStillAliveTimeout = TSrvSetting.ClientKeepAliveTimeoutAfterXSecondsLAN; } UClientStillAliveTimeout = ClientStillAliveTimeout; UClientStillAliveCheckInterval = TSrvSetting.ClientKeepAliveCheckIntervalInSeconds; UTearDownAppDomain = ATearDownAppDomain; // UTearDownAppDomainToken = ATearDownAppDomainToken; TLogging.LogAtLevel(2, "ClientStillAliveTimeout: " + ClientStillAliveTimeout.ToString() + "; " + "ClientKeepAliveCheckIntervalInSeconds: " + UClientStillAliveCheckInterval.ToString()); // Start ClientStillAliveCheckThread UKeepServerAliveCheck = true; UClientStillAliveCheckThread = new Thread(new ThreadStart(ClientStillAliveCheckThread)); UClientStillAliveCheckThread.Name = "ClientStillAliveCheckThread" + Guid.NewGuid().ToString(); UClientStillAliveCheckThread.IsBackground = true; UClientStillAliveCheckThread.Start(); TLogging.LogAtLevel(2, "TClientStillAliveCheck (for ClientName '" + ClientName + "'): started ClientStillAliveCheckThread."); }