コード例 #1
0
        public PuppetMasterServices(string confFile)
        {
            Pcs = new List <PcsService>();
            string serverLoc;

            TcpChannel channel = new TcpChannel();

            ChannelServices.RegisterChannel(channel, true);


            using (StreamReader file = File.OpenText(confFile))
            {
                string line;
                while ((line = file.ReadLine()) != null)
                {
                    serverLoc = "tcp://" + line + ":" + "10000/PcsService";

                    PcsService obj = (PcsService)Activator.GetObject(
                        typeof(PcsService),
                        serverLoc);

                    Pcs.Add(obj);
                }
            }

            processes = new List <string[]>();

            Console.WriteLine("Welcome Puppet Master");
        }
コード例 #2
0
        static void Main(string[] args)
        {
            TcpChannel channel = new TcpChannel(10000);

            ChannelServices.RegisterChannel(channel, true);


            PcsService mo = new PcsService(args[0], args[1], args[2]); //needs to be fixed


            RemotingServices.Marshal(mo, "PcsService",
                                     typeof(PcsService));

            Console.WriteLine("PCS");
            Console.WriteLine("Press <enter> to exit...");
            Console.ReadLine();
        }