// ----------------< 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); } }
// ----------------< 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); } }
// Implement service method to receive messages from other Peers public void PostMessage(SvcMsg msg) { msg.ShowMessage(); rcvBlockingQ.enQ(msg); }
// Implement service method to receive messages from other Peers public void PostMessage(SvcMsg msg) { msg.ShowMessage(); rcvBlockingQ.enQ(msg); }