예제 #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());

            TcpChannel channel = new TcpChannel(8086);
            ChannelServices.RegisterChannel(channel, true);

            RemotingConfiguration.RegisterWellKnownServiceType(
                typeof(PMcreateProcess),
                "PuppetMasterURL",
                WellKnownObjectMode.Singleton);

            Scanner scan = new Scanner();

            TreeNode root = scan.getRootNodeFromFile(conf_filename);

            //criar arvore a partir de root
            scan.readTreeFromFile(root, conf_filename);
            MessageBox.Show("depois de fazer a tree");
            //preencher lstProcess - lista de todos os processos no config file
            List<Process> lstProcess = scan.fillProcessList(conf_filename, root);
            MessageBox.Show("depois de fazer a lista");
            //estruturas para optimizar a procura
            Dictionary<string, string> pname_site = scan.getPname_site();
            Dictionary<string, TreeNode> site_treeNode = scan.getSite_Node();
            Dictionary<TreeNode, Broker> node_broker = scan.getNode_Broker();

            MessageBox.Show("finito");
        }
예제 #2
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());

            TcpChannel channel = new TcpChannel(Int32.Parse(args[0]));
            ChannelServices.RegisterChannel(channel, true);

            PMcreateProcess createProcess = new PMcreateProcess(Int32.Parse(args[0]));
            RemotingServices.Marshal(createProcess, "PuppetMasterURL", typeof(PMcreateProcess));

            /*
            RemotingConfiguration.RegisterWellKnownServiceType(
                typeof(PMcreateProcess),
                "PuppetMasterURL",
                WellKnownObjectMode.Singleton);*/


            //lancar slaves
            for (int i = 0; i < 2; i++) {

                ProcessStartInfo startInfo = new ProcessStartInfo(@"C:\DAD\PubSub_v3.1\localPM\bin\Debug\localPM.exe");
                int port = 9000 + (i*100);
                string arg = port.ToString();
                startInfo.Arguments = arg;

                Process p = new Process();
                p.StartInfo = startInfo;
                
                p.Start();
               
            }

            Scanner scan = new Scanner();
            
            TreeNode root = scan.getRootNodeFromFile(conf_filename);

            //criar arvore a partir de root
            scan.readTreeFromFile(root, conf_filename);
            

            //preencher lstProcess - lista de todos os processos no config file
            List<MyProcess> lstProcess = scan.fillProcessList(conf_filename, root);
            

            //estruturas para optimizar a procura
            Dictionary<string, string> pname_site = scan.getPname_site();
            Dictionary<string, TreeNode> site_treeNode = scan.getSite_Node();
            Dictionary<TreeNode, Broker> node_broker = scan.getNode_Broker();

            MessageBox.Show("finito");
        }
예제 #3
0
        public void readFile(string fileName)
        {
            conf_filename = proj_path + @"\" + fileName;

            Scanner scan = new Scanner();

            root = scan.getRootNodeFromFile(conf_filename);

            //criar arvore a partir de root
            scan.readTreeFromFile(root, conf_filename);

            scan.quickRead(conf_filename, root);

            //preencher lstProcess - lista de todos os processos no config file
            lstProcess = scan.fillProcessList(conf_filename, root);

            //estrutura que diz em que porta está cada processo
            pname_port = scan.getPname_port();

            int routingMode = scan.getRouting();//0-flood; 1-filter
            int orderMode = scan.getOrder();//0-NO; 1-FIFO; 2-TOTAL
            int logMode = scan.getLogMode();//0-light; 1-full

            ////lancar servico de LOG
            PMLog log = new PMLog(logMode);
            RemotingServices.Marshal(log, "PuppetMasterLog", typeof(PMLog));
        }
예제 #4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            scan = new Scanner();

            for (int i = 0; i < 7; i++)
            {

                ProcessStartInfo startInfo = new ProcessStartInfo(proj_path + @"\localPM\bin\Debug\localPM.exe");
                int port = 9000 + (i * 100);
                string arg = port.ToString();
                startInfo.Arguments = arg;

                Process p = new Process();
                p.StartInfo = startInfo;

                p.Start();

            }
        }