Пример #1
0
        public static void Main(string[] arg)
        {
            int n     = 10000;
            var proxy = new MyRemoteService();
            var param = new Param1();

            Console.WriteLine("Client set value for remote service");
            Stopwatch watch = new Stopwatch();

            watch.Start();
            for (int i = 0; i < n; i++)
            {
                var sucess = proxy.SetValue(i, param);
//				Console.WriteLine(i + sucess.ToString());
            }
            watch.Stop();
            Console.WriteLine(string.Format("Client seted value for remote service. Execution took {0} miliseconds", (float)watch.ElapsedMilliseconds / n));
            Console.ReadLine();
//            ServiceHost host = new ServiceHost(11885);
//            Console.WriteLine("host open ");
//            host.Container.RegisterService("My Service",
//                                new MyRemoteService(), false);
//            Console.WriteLine("registed service");
//            host.Open();
//            Console.ReadLine();
//            Console.WriteLine("Closing");
//            host.Close();
        }
Пример #2
0
        public static void Main(string[] arg)
        {
        	int n = 10000;
        	var proxy = new MyRemoteService();
			var param = new Param1();
			Console.WriteLine("Client set value for remote service");
			Stopwatch watch = new Stopwatch();
			watch.Start();
			for (int i = 0; i < n; i++)
			{
				var sucess = proxy.SetValue(i, param);
//				Console.WriteLine(i + sucess.ToString());
			}
			watch.Stop();
			Console.WriteLine(string.Format("Client seted value for remote service. Execution took {0} miliseconds", (float)watch.ElapsedMilliseconds / n));
        	Console.ReadLine();
//            ServiceHost host = new ServiceHost(11885);
//            Console.WriteLine("host open ");
//            host.Container.RegisterService("My Service",
//                                new MyRemoteService(), false);
//            Console.WriteLine("registed service");
//            host.Open();
//            Console.ReadLine();
//            Console.WriteLine("Closing");
//            host.Close();
        }