Ejemplo n.º 1
0
            /// <summary>
            /// Constructor for passing in parameters.
            /// </summary>
            public TClientStillAliveCheck(TConnectedClient AConnectedClient,
                                          TClientServerConnectionType AClientServerConnectionType,
                                          TDelegateTearDownAppDomain ATearDownAppDomain,
                                          string AUser = "")
            {
                FClientObject = AConnectedClient;
                ClientName    = FClientObject.ClientName;

                // 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");

                Int32 ClientStillAliveTimeout = TAppSettingsManager.GetInt32("Server.ClientKeepAliveTimeoutAfterXSeconds_LAN", 60);

                UClientStillAliveTimeout       = ClientStillAliveTimeout;
                UClientStillAliveCheckInterval = TAppSettingsManager.GetInt32("Server.ClientKeepAliveCheckIntervalInSeconds", 60);
                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);
            }
Ejemplo n.º 2
0
        /// start the session
        public void StartSession(TDelegateTearDownAppDomain ATearDownAppDomain)
        {
            FTasksManager    = new TClientTasksManager();
            FPollClientTasks = new TPollClientTasks(FTasksManager);

            FClientConnectionStartTime = DateTime.Now;

            // Start ClientStillAliveCheck Thread
            new ClientStillAliveCheck.TClientStillAliveCheck(this, FClientServerConnectionType, ATearDownAppDomain);

            SessionStatus = TSessionStatus.adsActive;
            FClientConnectionFinishedTime = DateTime.Now;
        }
Ejemplo n.º 3
0
            /// <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);
            }
Ejemplo n.º 4
0
            /// <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.");
            }
Ejemplo n.º 5
0
            /**
             * Constructor for passing in parameters.
             *
             * @param AClientServerConnectionType Type of Client connection
             * @param ATearDownAppDomain Delegate that is called once
             * ClientStillAliveCheckThread finds out that the Client is no longer 'alive'
             * @param ATearDownAppDomainToken Security Token. Prevents against unauthorized
             * tearing down of the Client's AppDomain.
             *
             */
            public TClientStillAliveCheck(TClientServerConnectionType AClientServerConnectionType,
                                          TDelegateTearDownAppDomain ATearDownAppDomain,
                                          String ATearDownAppDomainToken)
            {
                Int32 ClientStillAliveTimeout;

                if (TLogging.DL >= 10)
                {
                    Console.WriteLine("{0} TClientStillAliveCheck created", DateTime.Now);
                }

                // 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;

                // Start ClientStillAliveCheckThread
                UKeepServerAliveCheck        = true;
                UClientStillAliveCheckThread = new Thread(new ThreadStart(ClientStillAliveCheckThread));
                UClientStillAliveCheckThread.IsBackground = true;
                UClientStillAliveCheckThread.Start();

                if (TLogging.DL >= 10)
                {
                    Console.WriteLine("{0} TClientStillAliveCheck: started ClientStillAliveCheckThread.", DateTime.Now);
                }
            }
Ejemplo n.º 6
0
        /// start the session
        public void StartSession(TDelegateTearDownAppDomain ATearDownAppDomain)
        {
            FTasksManager = new TClientTasksManager();
            FPollClientTasks = new TPollClientTasks(FTasksManager);

            FClientConnectionStartTime = DateTime.Now;

            // Start ClientStillAliveCheck Thread
            new ClientStillAliveCheck.TClientStillAliveCheck(this, FClientServerConnectionType, ATearDownAppDomain);

            SessionStatus = TSessionStatus.adsActive;
            FClientConnectionFinishedTime = DateTime.Now;
        }
Ejemplo n.º 7
0
            /// <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.");
            }
Ejemplo n.º 8
0
            /**
             * Constructor for passing in parameters.
             *
             * @param AClientServerConnectionType Type of Client connection
             * @param ATearDownAppDomain Delegate that is called once
             * ClientStillAliveCheckThread finds out that the Client is no longer 'alive'
             * @param ATearDownAppDomainToken Security Token. Prevents against unauthorized
             * tearing down of the Client's AppDomain.
             *
             */
            public TClientStillAliveCheck(TClientServerConnectionType AClientServerConnectionType,
                TDelegateTearDownAppDomain ATearDownAppDomain,
                String ATearDownAppDomainToken)
            {
                Int32 ClientStillAliveTimeout;

                if (TLogging.DL >= 10)
                {
                    Console.WriteLine("{0} TClientStillAliveCheck created", DateTime.Now);
                }

                // 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;

                // Start ClientStillAliveCheckThread
                UKeepServerAliveCheck = true;
                UClientStillAliveCheckThread = new Thread(new ThreadStart(ClientStillAliveCheckThread));
                UClientStillAliveCheckThread.IsBackground = true;
                UClientStillAliveCheckThread.Start();

                if (TLogging.DL >= 10)
                {
                    Console.WriteLine("{0} TClientStillAliveCheck: started ClientStillAliveCheckThread.", DateTime.Now);
                }
            }