blob: cfe2a0691607c27ed2608b91d9fa097a6c59a0c6 [file] [log] [blame]
Jan Tattermuscha7fff862015-02-13 11:08:08 -08001#region Copyright notice and license
Jan Tattermuschaf77b3d2015-02-13 11:22:21 -08002// Copyright 2015, Google Inc.
Jan Tattermuscha7fff862015-02-13 11:08:08 -08003// All rights reserved.
Craig Tiller190d3602015-02-18 09:23:38 -08004//
Jan Tattermuscha7fff862015-02-13 11:08:08 -08005// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
Craig Tiller190d3602015-02-18 09:23:38 -08008//
Jan Tattermuscha7fff862015-02-13 11:08:08 -08009// * Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11// * Redistributions in binary form must reproduce the above
12// copyright notice, this list of conditions and the following disclaimer
13// in the documentation and/or other materials provided with the
14// distribution.
15// * Neither the name of Google Inc. nor the names of its
16// contributors may be used to endorse or promote products derived from
17// this software without specific prior written permission.
Craig Tiller190d3602015-02-18 09:23:38 -080018//
Jan Tattermuscha7fff862015-02-13 11:08:08 -080019// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Jan Tattermuscha7fff862015-02-13 11:08:08 -080030#endregion
Jan Tattermuscha7608b02015-02-03 17:54:38 -080031using System;
32using System.Runtime.InteropServices;
Jan Tattermuscha7608b02015-02-03 17:54:38 -080033using System.Threading;
Jan Tattermusch30868622015-02-19 09:22:33 -080034using Grpc.Core;
Jan Tattermuscha7608b02015-02-03 17:54:38 -080035
Jan Tattermuscheb3e76e2015-02-06 11:43:13 -080036namespace math
Jan Tattermuscha7608b02015-02-03 17:54:38 -080037{
Jan Tattermusch13cd1252015-03-06 10:11:50 -080038 class MathClient
Jan Tattermuscha7608b02015-02-03 17:54:38 -080039 {
Jan Tattermusch13cd1252015-03-06 10:11:50 -080040 public static void Main(string[] args)
41 {
Jan Tattermuschda71a4d2015-06-08 15:36:53 -070042 using (Channel channel = new Channel("127.0.0.1", 23456))
Jan Tattermusch13cd1252015-03-06 10:11:50 -080043 {
Jan Tattermusche5c9b802015-07-14 17:46:58 -070044 Math.IMathClient client = new Math.MathClient(channel);
45 MathExamples.DivExample(client);
Jan Tattermuscha7608b02015-02-03 17:54:38 -080046
Jan Tattermusche5c9b802015-07-14 17:46:58 -070047 MathExamples.DivAsyncExample(client).Wait();
Jan Tattermuscha7608b02015-02-03 17:54:38 -080048
Jan Tattermusche5c9b802015-07-14 17:46:58 -070049 MathExamples.FibExample(client).Wait();
Jan Tattermuscha7608b02015-02-03 17:54:38 -080050
Jan Tattermusche5c9b802015-07-14 17:46:58 -070051 MathExamples.SumExample(client).Wait();
Jan Tattermusch8c61db92015-04-02 15:22:31 -070052
Jan Tattermusche5c9b802015-07-14 17:46:58 -070053 MathExamples.DivManyExample(client).Wait();
Jan Tattermusch8c61db92015-04-02 15:22:31 -070054
Jan Tattermusche5c9b802015-07-14 17:46:58 -070055 MathExamples.DependendRequestsExample(client).Wait();
Jan Tattermusch13cd1252015-03-06 10:11:50 -080056 }
Craig Tiller190d3602015-02-18 09:23:38 -080057
Jan Tattermuscha7608b02015-02-03 17:54:38 -080058 GrpcEnvironment.Shutdown();
Jan Tattermusch13cd1252015-03-06 10:11:50 -080059 }
60 }
Jan Tattermuscha7608b02015-02-03 17:54:38 -080061}