Esempio n. 1
0
        static void Main(string[] args)
        {
            AppContext.SetSwitch(
                "System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport",
                true);

            PMConfiguration config = ParseArgs(args);

            Console.WriteLine(
                "[{0}] Puppet Master started with version {1}",
                DateTime.Now.ToString("HH:mm:ss"),
                config.Version);

            NameServiceDB nameServiceDB = new NameServiceDB();
            PMController  controller    = new PMController(config, nameServiceDB);

            using TextReader textReader = config.InputSource;
            string   line;
            ICommand command;

            while ((line = textReader.ReadLine()) != null)
            {
                if (!TryParse(line, out command))
                {
                    Console.WriteLine("Invalid Command");
                    continue;
                }
                command.Accept(controller);
            }

            Console.WriteLine(
                "[{0}] Instructions Completed. Press any key to exit...",
                DateTime.Now.ToString("HH:mm:ss"));
            Console.ReadKey();
        }
Esempio n. 2
0
 public PMController(PMConfiguration config, NameServiceDB nameServiceDB)
 {
     this.config        = config;
     this.nameServiceDB = nameServiceDB;
 }