Last active
November 10, 2020 22:05
-
-
Save cheoalfredo/d88221415cf95f7a2109001a763b2bdd to your computer and use it in GitHub Desktop.
C# Cliente gRPC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Grpc.Net.Client; | |
using System.Threading.Tasks; | |
using MyServer; | |
namespace MyClient | |
{ | |
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
using var channel = GrpcChannel.ForAddress("https://localhost:5001"); | |
var client = new OperacionMatematica.OperacionMatematicaClient(channel); | |
var reply = await client.DivideAsync(new MyServer.DivisionRequest | |
{ | |
Dividendo = 524, Divisor = 63 | |
}); | |
Console.WriteLine("cociente: " + reply.Cociente); | |
Console.WriteLine("Residuo : " + reply.Residuo); | |
Console.WriteLine("Press any key to exit..."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment