コード例 #1
0
 private static void Setup()
 {
     pingServer = new Server
     {
         Services =
         {
             PingPong.BindService(new PingPongService()),
         },
         Ports = { new ServerPort("127.0.0.1", (int)PingConstants.Port, ServerCredentials.Insecure) }
     };
     pingServer.Start();
 }
コード例 #2
0
ファイル: GrpcPingPong.cs プロジェクト: hyiltiz/bond
        public static void Main()
        {
            pingServer = new Server
            {
                Services =
                {
                    PingPong <PingRequest> .BindService(new PingPongService()),
                    DoublePing.BindService(new DoublePingService())
                },
                Ports = { new ServerPort("localhost", PingPort, ServerCredentials.Insecure) }
            };
            pingServer.Start();

            pingChannel = new Channel("localhost", PingPort, ChannelCredentials.Insecure);

            var tasks = MakeRequestsAndPrintAsync(5);

            Task.WaitAll(tasks);

            Shutdown();

            Console.WriteLine("\n\n\nDone with all requests.");
        }