private static async Task RunBiStream(GreeterClient client) { var duplex = client.Echo(); await foreach (var item in duplex.ResponseStream.ToEnumerable()) { var message = item.Message; if (message.Length > 10000) { message = "Let's start again"; } Console.WriteLine(message); await duplex.RequestStream.WriteAsync(new EchoMessage { Message = message }); } }