Ejemplo n.º 1
0
        private static async Task ClientStreaming()
        {
            using (var call = _client.ClientStreaming())
            {
                for (var i = 0; i < 5; i++)
                {
                    await Task.Delay(1000);

                    await call.RequestStream.WriteAsync(new StreamRequest
                    {
                        Message = "Simple message",
                        Count   = i
                    });
                }

                await call.RequestStream.CompleteAsync();

                var response = await call.ResponseAsync;

                Console.WriteLine(response.Message);
            }
        }