Skip to content

Instantly share code, notes, and snippets.

@cheoalfredo
Last active November 10, 2020 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cheoalfredo/d88221415cf95f7a2109001a763b2bdd to your computer and use it in GitHub Desktop.
Save cheoalfredo/d88221415cf95f7a2109001a763b2bdd to your computer and use it in GitHub Desktop.
C# Cliente gRPC
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