private void Run()
        {
            if (_stopRequest.WaitOne(10000))
            {
                return;
            }
            try
            {
                var frequency      = Settings.Default.KickFrequency * 1000;
                var connectionName = Settings.Default.ConnectionName;
                var remoteSite     = Settings.Default.RemoteSite;
                var kickLength     = Settings.Default.KickLength;

                while (true)
                {
                    var netKicker = new NetworkKicker(connectionName)
                    {
                        KickLength = kickLength,
                        RemoteSite = remoteSite
                    };
                    netKicker.LogContentReady += OnLogReady;
                    netKicker.Run();
                    Thread.Sleep(frequency);
                }
            }
            catch (Exception ex)
            {
                Log.Write(ex);
            }
        }
示例#2
0
        private static void Main(string[] args)
        {
            try
            {
                var frequency      = Settings.Default.KickFrequency * 1000;
                var connectionName = Settings.Default.ConnectionName;

                while (true)
                {
                    var netKicker = new NetworkKicker(connectionName);
                    netKicker.LogContentReady += OnLogReady;
                    netKicker.Run();
                    Thread.Sleep(frequency);
                }
            }
            catch (Exception ex)
            {
                Log.Write(ex);
            }
        }