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"); }
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"); }