static void Main(string[] args) { //Debugger.Launch(); if (args.Length < 6) { Console.WriteLine("Invalid Argument Count"); return; } String type = args[0]; int port = Int32.Parse(args[1]); Boolean fullLog = args[2].Equals("full") ? true : false; String routing = args[3]; String[] input = args[4].Split(','); String[] output = args[5].Split(','); String[] output_op = args[6].Split(','); String[] replicas_op = args[7].Split(','); String[] parameters = null; if (args.Length > 8) { parameters = args[8].Split(','); if (parameters[0] == null || parameters[0].Equals("")) { parameters = null; } } if (input[0] == null || input[0].Equals("")) { input = null; } if (output[0] == null || output[0].Equals("")) { output = null; } TcpChannel channel = new TcpChannel(port); ChannelServices.RegisterChannel(channel, true); RemoteOperator remoteOperator = createOperatorType(type, fullLog, routing, input, output, output_op, replicas_op, parameters); RemotingServices.Marshal(remoteOperator, "op", remoteOperator.GetType()); Console.WriteLine("Started Operator " + type + " on port " + port); Console.ReadLine(); }
private void crashAllButton_Click(object sender, EventArgs e) { List <string> urls = new List <string>(); foreach (List <string> op_urls in operatorsURL.Values) { for (int j = 0; j < op_urls.Count; j++) { try { RemoteOperator rm_op = (RemoteOperator)Activator.GetObject(typeof(RemoteOperator), op_urls[j]); rm_op.crashOperator(); } catch { } } } logTextBox.AppendText("<PuppetMaster>: All Operators were crashed!;\r\n"); }
static void Main(string[] args) { TcpChannel channel = new TcpChannel(); ChannelServices.RegisterChannel(channel, true); RemotePCS obj = (RemotePCS)Activator.GetObject(typeof(RemotePCS), "tcp://localhost:10000/RemotePCS"); // obj.createOperator("COUNT", 10010, true, "primary", null, new String[] { "tcp://localhost:10011/op" }, null); //obj.createOperator("DUP", 10011, true, "primary", null, null, null); RemoteOperator count = (RemoteOperator)Activator.GetObject(typeof(RemoteOperator), "tcp://localhost:10010/op"); CommonTypes.Tuple t1 = CommonTypes.Tuple.fromString("1,2,3"); CommonTypes.Tuple t2 = CommonTypes.Tuple.fromString("1,2,2"); CommonTypes.Tuple t3 = CommonTypes.Tuple.fromString("1,3,3"); CommonTypes.Tuple t4 = CommonTypes.Tuple.fromString("1,4,1"); System.Threading.Thread.Sleep(4000); //count.process(t1); Console.ReadLine(); }