How to Pass a a list of data like array or vector (using repeated in protobuf file) from server to client using stream data.

30 views
Skip to first unread message

rohit nv

unread,
May 31, 2020, 12:19:50 PM5/31/20
to grpc.io

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<std::tuple<int,int, float>> Container;



Would like to know how can I pass the container.

yas...@google.com

unread,
Jun 10, 2020, 12:08:55 PM6/10/20
to grpc.io
Hi, 

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

Hope that helps. Cheers!

Reply all
Reply to author
Forward
Message has been deleted
0 new messages