[grpc-io] Re: How to Pass a a list of data like array or vector (using repeated in protobuf file) from server to client using stream data.

2020-06-11 Thread rohit nv
Thanks for the reply..

I have one more doubt. Can we use a repeated (vector or map ) to send data 
for a streamed communication.

e.g 


syntax = "proto3";

import "google/protobuf/empty.proto";

message Dummy {
  string foo = 1;
  repeated int bar = 2;
}

message DummyList {
  Dummy dummy = 1;
}

service DummyService {
  rpc getDummyListWithRepeated(google.protobuf.Empty) returns (DummyList) {}
}

Want to know how can I use the DummyList in a c++ project  to copy the 
value from a  vector of integer values into bar field of Dummy message.



Thank you..!

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/880763fa-8210-4abf-be42-8b1b0d426c7eo%40googlegroups.com.


[grpc-io] Re: How to Pass a a list of data like array or vector (using repeated in protobuf file) from server to client using stream data.

2020-06-10 Thread 'yas...@google.com' via grpc.io
Hi, 

It seems like you are looking for help with usage of protobuf for repeated 
fields. 

protobuf has pretty good documentations for such stuff - 
https://developers.google.com/protocol-buffers/docs/reference/cpp-generated#repeatedmessage
 
Hope that helps. Cheers!

On Sunday, May 31, 2020 at 9:19:50 AM UTC-7 san...@gmail.com wrote:

>
> How to  Pass a a vector  (using repeated in protobuf file) from server to 
> client using stream
>
> The gRPC server client interaction is stream.
>
>
> //---STRUCTURE OF PROTO 
> FILE-
> message Response
> {
>
> int param1 = 20;
>
> int param2 = 30;
>
> float param2 = 30;
> }. ..
>
>
> message ParamResponse
> {
>
> *repeated *Response =20;
>
> }
>
>  // RPC calls from Client to Serve
> rpc Read( readyCommand ) returns ( stream *ParamResponse *){ }
>
>
>
> --
>
> In CPP project -
>
>
> *sendDatato Client (   ,. ..,,,  ParamResponse DataResponse  )*
> *{*
>
> typedef std::vector> Container;
>
>
> *} *
>
> Would like to know how can I pass the container.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/522f141c-1d76-4523-921b-5a07b326d956n%40googlegroups.com.