Пример #1
0
        //private static void AkkaHello(RpcContractAkka.IHelloService akkaServiceHttp, string helloword = "world")
        //{
        //    var callNameVoid = akkaServiceHttp.CallNameVoid();
        //    Console.WriteLine(callNameVoid);
        //    akkaServiceHttp.CallName(new RpcContractAkka.NameResult { Name = helloword });
        //    Console.WriteLine("CallName called");
        //    akkaServiceHttp.CallVoid();
        //    Console.WriteLine("CallVoid called");
        //    var hello = akkaServiceHttp.Hello(new RpcContractAkka.NameResult { Name = helloword });
        //    Console.WriteLine(hello.Name);
        //    var helloResult = akkaServiceHttp.SayHello(new RpcContractAkka.NameResult { Name = $"{helloword} perfect world" });
        //    Console.WriteLine($"{helloResult.Name},{helloResult.Gender},{helloResult.Head}");
        //    helloResult.Name = helloword + "show perfect world";
        //    var showResultWcf = akkaServiceHttp.ShowHello(helloResult);
        //    Console.WriteLine(showResultWcf.Name);
        //}
        private static async Task NettyHello(RpcContractNetty.IHelloService nettyService, string helloword = "world")
        {
            Console.WriteLine("NettyHello---------------------------------------------------------------------------");
            var callNameVoid = await nettyService.CallNameVoidAsync();

            Console.WriteLine(callNameVoid);
            await nettyService.CallNameAsync(helloword);

            Console.WriteLine("CallName called");
            await nettyService.CallVoidAsync();

            Console.WriteLine("CallVoid called");
            var hello = await nettyService.HelloAsync(helloword);

            Console.WriteLine(hello);
            var helloResult = await nettyService.SayHelloAsync($"{helloword} perfect world");

            Console.WriteLine($"{helloResult.Name},{helloResult.Gender},{helloResult.Head}");
            helloResult.Name = helloword + "show perfect world";
            var showResultNetty = await nettyService.ShowHelloAsync(helloResult);

            Console.WriteLine(showResultNetty);

            NettyHelloCall(nettyService, helloword);
        }
Пример #2
0
        private static void NettyHello(RpcContractNetty.IHelloService nettyServiceHttp, string helloword = "world")
        {
            var callNameVoid = nettyServiceHttp.CallNameVoid();

            Console.WriteLine(callNameVoid);
            nettyServiceHttp.CallName(helloword);
            Console.WriteLine("CallName called");
            nettyServiceHttp.CallVoid();
            Console.WriteLine("CallVoid called");
            var hello = nettyServiceHttp.Hello(helloword);

            Console.WriteLine(hello);
            var helloResult = nettyServiceHttp.SayHello($"{helloword} perfect world");

            Console.WriteLine($"{helloResult.Name},{helloResult.Gender},{helloResult.Head}");
            helloResult.Name = helloword + "show perfect world";
            var showResultNetty = nettyServiceHttp.ShowHello(helloResult);

            Console.WriteLine(showResultNetty);
        }