예제 #1
0
        private static void Main(string[] args)
        {
            var p = new Program();

            Binding binding = new QpidBinding("192.168.1.14", 5673);

            p.StartService(binding);


            IUpperCase calc = p.StartClient(new QpidBinding("192.168.1.14", 5673));

            string[] messages = { "Twas brillig, and the slithy toves",
                                  "Did gire and gymble in the wabe.  ",
                                  "All mimsy were the borogroves,    ",
                                  "And the mome raths outgrabe.      " };
            foreach (string m in messages)
            {
                Console.Write(m + "  --UperCase-->  ");
                Console.Write(calc.ToUpperCase(m));
                Console.WriteLine();
            }

            Console.ReadLine();

            p.StopClient(calc);
            p.StopService();
        }
예제 #2
0
 public void StopClient(IUpperCase client)
 {
     Console.WriteLine("  Stopping Client...");
     ((IChannel)client).Close();
     fac.Close();
     Console.WriteLine("[DONE]");
 }
예제 #3
0
 public void StopClient(IUpperCase client)
 {
     Console.WriteLine("  Stopping Client...");
     ((IChannel) client).Close();
     fac.Close();
     Console.WriteLine("[DONE]");
 }
예제 #4
0
        public IUpperCase StartClient(Binding binding)
        {
            IUpperCase res = null;

            try
            {
                Console.WriteLine("  Starting Client...");
                fac = new ChannelFactory <IUpperCase>(binding, "soap.amqp:///UpperCase");
                fac.Open();
                res = fac.CreateChannel();
                Console.WriteLine("[DONE]");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(res);
        }