7

I have a program written in C and want to include gRPC in it. However, the API for gRPC is written in C++.

I've looked here and got the foo_client and foo_server working. https://github.com/Juniper/grpc-c/tree/master/examples

However, the C client is not compatible with my gRPC C++ server. They will not talk to each other. I believe it is because I am using the lates gRPC which uses protocbuf version 3.2.0. And Juniper's grpc-c is using an older version of gRPC that uses protocbuf version 3.0.0.

So the Juniper version in C doesn't seem to work with the new gRPC. I know the gRPC low level C API is supposed to be here: https://github.com/grpc/grpc/blob/master/include/grpc/grpc.h But I'm having difficulty implementing it. Can anyone help me make sense of it?

I haven't programmed in C in awhile so I'm a little rusty.

cyanbreak
  • 81
  • 1
  • 4

1 Answers1

5

If you are using the gRPC core library directly, then you will need to perform your own serialization, and deal with low level operations documented in https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/grpc_types.h.

If you have any specific questions, we will be happy to help, but if this is just a one-time thing it might be easier to just solve the version incompatibility problem, or maybe simply wrap the C++ implementation with a C interface.

Yash Tibrewal
  • 427
  • 2
  • 4