using (var call = client.Sum())
{
await call.RequestStream.WriteAllAsync(numbers);
Console.WriteLine("Sum Result: " + await call.ResponseAsync);
}public class Connection
{
private readonly IClientStreamWriter<Request> _clientSideStream;
public Connection(RequestService.RequestServiceClient client)
{
// get a reference to the stream
_clientSideStream = client.TransactionExchangeClientStream().RequestStream;
}
// called a lot by multiple threads
public async Task SendAsync(Request request)
{
await _clientSideStream.WriteAsync(request);
}
// when the app decides to stop talking entirely to the server
public async Task CloseConnection()
{
await _clientSideStream.CompleteAsync().ConfigureAwait(false);
}
}--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/613fea5a-fe51-40b5-a69f-cbf82190b797%40googlegroups.com.
Jan