public void stopKernel(Comunication comunicationSet) { comunicationSet.sendMessage("{cmd:stop,src:kernel,dst:GUI,msg:\"Stop System\"}", 8081); comunicationSet.sendMessage("{cmd:stop,src:kernel,dst:GestorArc,msg:\"Stop System\"}", 8082); comunicationSet.sendMessage("{cmd:stop,src:kernel,dst:APP,msg:\"Stop System\"}", 8083); System.Environment.Exit(1); }
private void longMessage(string[] msgClean, string rawMsg) { switch (msgClean[2].Split(':')[1]) { case "GUI": comunication.sendMessage(rawMsg, 8081); comunication.sendMessage(rawMsg, 8082); break; case "GestorArc": comunication.sendMessage(rawMsg, 8082); break; case "kernel": if (msgClean[0].Split(':')[1] == "start" && msgClean[1].Split(':')[1] == "GUI") { comunication.sendMessage(rawMsg, 8082); string msg = core.startApp(); comunication.sendMessage(msg, 8081); comunication.sendMessage(msg, 8082); } else if (msgClean[0].Split(':')[1] == "stop" && msgClean[1].Split(':')[1] == "GUI") { comunication.sendMessage(rawMsg, 8082); if (core.isAppRunnig()) { Console.WriteLine("aaaaaaaaaaaaa2"); comunication.sendMessage("{cmd:stop,src:kernel,dst:APP,msg:\"Stop System\"}", 8083); string msg = core.stoptApp(); comunication.sendMessage(msg, 8081); comunication.sendMessage(msg, 8082); } else { comunication.sendMessage("{cmd:send,src:kernel,dst:GUI,msg:\"Error->App not running\"}", 8081); comunication.sendMessage("{cmd:send,src:kernel,dst:GUI,msg:\"Error->App not running\"}", 8082); } } else { comunication.sendMessage(rawMsg, 8082); core.stopKernel(comunication); } break; case "APP": comunication.sendMessage(rawMsg, 8083); comunication.sendMessage(rawMsg, 8082); break; default: break; } }