Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.Write("\n   demo of process pool");
            Console.Write("\n   ==============================");
            ProcessPool repo = new ProcessPool();

            repo.createprocess(2);

            Console.Write("\n\n");
        }
        static void Main(string[] args)
        {
            Console.Write("\n  Mother Builder");
            Console.Write("\n ================\n");

            Console.Title           = "MotherBuilder";
            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.White;
            MotherBuilder Server = new MotherBuilder();

            Console.Write("\n  Requirement2: Using a Message-Passing Communication Service built with WCF\n");

            Console.Write("\n  Requirement 5: This module provides a Process Pool component that creates a specified number of processes on command\n");

            ProcessPool.ProcessPool pp = new ProcessPool.ProcessPool();
            if (args.Count() == 0)
            {
                Console.Write("\n  please enter number of processes to create on command line");
                return;
            }
            else
            {
                int count = Int32.Parse(args[0]);
                if (count > 10 || count < 0)
                {
                    Console.WriteLine("\n  Please enter a value between 1 to 10");
                    return;
                }
                portsCreated = pp.processPool(count);
            }

            Message msg = Server.makeMessage("Nupur", Server.endPoint, Server.endPoint);

            Console.ReadKey();
            Console.Write("\n\n");
        }