예제 #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Start searching");
            var configs    = Greeter.Search();
            var sel_addr   = "";
            var sel_config = new Config();

            foreach (KeyValuePair <string, Config> config in configs)
            {
                Console.WriteLine("IP: " + config.Key);
                Console.WriteLine("IP: " + config.Value.VersionStr);
                sel_addr   = config.Key;
                sel_config = config.Value;
            }
            Console.WriteLine("Done searching");

            var cacher = new Cacher();

            cacher.Changed += HandleCacher;
            cacher.Connect(sel_config, sel_addr);
            while (true)
            {
                cacher.Check();
            }
        }
예제 #2
0
        public Form1()
        {
            InitializeComponent();

            cacher.Changed += cacher_Changed;

            // thread to keep checking
            bg = new Thread(() =>
            {
                while (alive)
                {
                    cacher.Check();
                }
            });
            bg.Start();
        }