static void projectListProcessing(SvcMsg msg) { Intermediator im = new Intermediator(); msg.body = im.getprojectList(); clientConnect(msg); }
// ----------------< Proceesed client Request >---------------- public static void clientProcessing(SvcMsg msg) { Intermediator im = new Intermediator(); im.clearRepository(); if (msg.cmd.ToString().Equals("Dependency")) { Console.Write("\n This is the new Request from Client for Dependency............\n\n"); msg.ShowMessage(); dependencyProcessing(msg); } if (msg.cmd.ToString().Equals("DependencyAll")) { Console.Write("\n This is the slients Request from Client for All Package Dependency ............\n\n"); msg.ShowMessage(); allDependencyProcessing(msg); } if (msg.cmd.ToString().Equals("ProjectList")) { Console.Write("\n This is the new Request from Client for ProjectList............\n\n"); msg.ShowMessage(); projectListProcessing(msg); } }
// ----------------< Proceesed Server Request >---------------- public static void serverProcessing(SvcMsg msg) { if (msg.cmd.ToString().Equals("Response")) { Console.Write("\nThis is the Response from Server............\n\n"); msg.ShowMessage(); responeFromServerTesting(msg.body.ToString()); } if (msg.cmd.ToString().Equals("Request")) { Console.Write("\nThis is the Request from Server for TypeTable............\n\n"); msg.ShowMessage(); Intermediator im = new Intermediator(); string typeTable = im.getTypeTable(); SvcMsg msg1 = new SvcMsg(); msg1.src = new Uri(src); msg1.dst = new Uri(dst); msg1.cmd = SvcMsg.Command.Response; msg1.body = typeTable; Sender.sendingServer(msg1); } }
static void Main(string[] args) { Console.Title = "Server2"; Server server = new Server(); Intermediator im = new Intermediator(); im.projectScanning(args[0]); im.intialTypeTable(args[0]); try { ServiceHost host = CreateServiceChannel("http://localhost:9002/MessageService"); host.Open(); Thread rcvThrd = new Thread(Receiver.ThreadProcedure); rcvThrd.IsBackground = true; rcvThrd.Start(); Thread rcvThrdServer = new Thread(Receiver.ThreadProcedureServer); rcvThrdServer.IsBackground = true; rcvThrdServer.Start(); Console.Write("\n press key to terminate service\n"); Console.ReadKey(); Console.Write("\n"); host.Close(); } catch (Exception ex) { Console.Write("\n\n" + ex.Message); } }
static void Main(string[] args) { Intermediator im = new Intermediator(); im.projectScanning("../../../TESTFOLDER"); string dire = im.getprojectList(); Console.Write("\n\nProjectList:\n{0}", dire); im.intialTypeTable("../../../TESTFOLDER"); string typeT = im.getTypeTable(); Console.Write("\n\nOwn TypeTable:\n{0}", typeT); im.typeTableMerging(typeT); string direName = "../../../TESTFOLDER/Directory1"; im.dependencyAnalysis(direName); string direName1 = "../../../TESTFOLDER/Directory2"; im.dependencyAnalysisAll(direName1); string depenResult = im.getDependencyResult(); Console.Write("\n\nDependency Result:\n{0}", depenResult); string depenAllResult = im.getDependencyAllResult(); Console.Write("\n\nInComing Dependency Result:\n{0}", depenAllResult); }
static void dependencyProcessing(SvcMsg msg) { string temp = ""; bool connect = false; DateTime timeout = DateTime.Now; timeout.AddSeconds(5); try { serverConnect(); } catch (Exception ex) { Console.Write("\n\n" + ex.Message); } finally { while (true) { if (check == true) { temp = typeFromOtherServer; connect = true; break; } if (DateTime.Compare(timeout, DateTime.Now) < 0) { connect = false; break; } } Intermediator im = new Intermediator(); if (connect) { im.typeTableMerging(typeFromOtherServer); } im.dependencyAnalysis(msg.body.ToString()); msg.body = im.getDependencyResult(); clientConnect(msg); } }