Beispiel #1
0
    /// <summary>
    /// This example uses the Grpc operations on the stats service client. The Grpc methods allow specifying
    /// Grpc Headers and are tightly coupled with the Grpc interfaces.
    /// </summary>
    private static async Task GrpcOperations(EchoService.EchoServiceClient client)
    {
        // Unary operation
        {
            SingleMessage unaryResponse = await client.EchoUnary(new SingleMessage { Message = "hi there" }, default);

            Console.WriteLine($"EchoUnary: {unaryResponse.Message}");
        }

        // Client streaming
        {
            AsyncClientStreamingCall <SingleMessage, MultiMessage> call = client.EchoClientStreaming(default);