Environment is Visual Studio 2017 (x64, all static builds )
Client is streaming messages
pseudo code follows:
std::unique_ptr<grpc::ClientWriter<MyDataset> > writer ( stub_->data_send (
&context, &response ) );
MyDataset data;
// reading data from a csv file and sending to the server 10 rows at a time.
writer->Write(data);
writer->WritesDone();
writer->Finish();
Server is reading :
grpc::ServerReader<MyDataset>* stream;
MyDataset buff;
while ( stream->Read ( &buff ) )
{
//process 10 rows, save them into a file. I am assuming every read
fetches 10 rows no more no less but I am not sure if this is guaranteed
buff.mutable_row()->Clear(); // this call does not have any effect
for some reason. But I want to clear so that the buffer does not grow too
large.
}
What I get in the file on the server is more rows than was sent from the
client. The client send 100 rows but on the server I am saving 550 rows !!
How do I reset the message buffer after I have finished reading one batch?
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/62a6b3bd-c138-4471-aae0-d89a7f268a5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.