gRPC C API

3,696 views
Skip to first unread message

xmx

unread,
Jul 20, 2015, 11:03:49 AM7/20/15
to grp...@googlegroups.com
Hello,
I would like to write a basic gRPC client/server implementation in pure C for testing purpose.
Is there any documentation or example on how to use the C API ?

Thanks in advance !

Craig Tiller

unread,
Jul 20, 2015, 11:11:13 AM7/20/15
to xmx, grp...@googlegroups.com
As a warning: our C layer is quite low level and misses many of the conveniences of our higher level languages (particularly when it comes to method invocation and protobuf serialization). If these are important, I'd recommend our C++ library.

That said, there are test suites located in test/core/** that will show some basic usage. The API itself is documented in include/grpc/grpc.h (and it's siblings).

--
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 post to this group, send email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/575c7fcb-c356-4aa9-ae3e-723631b4264a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

wattgo...@gmail.com

unread,
Jul 20, 2015, 11:37:20 AM7/20/15
to grp...@googlegroups.com, wattgo...@gmail.com
Thanks for your answer,
I will start with the test suite :)
Is there any plan to have a higher level C API ?

Craig Tiller

unread,
Jul 20, 2015, 12:57:35 PM7/20/15
to wattgo...@gmail.com, grp...@googlegroups.com
It's something that's certainly interesting for us, but it's not something we've had the bandwidth to tackle properly yet.

Rolf Sommerhalder

unread,
Mar 5, 2017, 4:00:46 AM3/5/17
to grpc.io, wattgo...@gmail.com
Hello,


On Monday, July 20, 2015 at 6:57:35 PM UTC+2, Craig Tiller wrote:
It's something that's certainly interesting for us, but it's not something we've had the bandwidth to tackle properly yet.

Was there any progress on plain old, pure C API support in gPRC since summer 2015?

Googler Sameer Ahmani had enumerated "C" in bold and at first position in his nice gRPC presentation: "Ten languages: C, Java, Go, C++, ..."

For a Proof of Concept that involves a legacy server library that is written in C, gRPC API C would probably be a much better fit for the server side than having to wrap it in C++ or Go API...

Thanks!

ajhai

unread,
Mar 6, 2017, 4:24:21 PM3/6/17
to grpc.io, wattgo...@gmail.com
On Sunday, March 5, 2017 at 1:00:46 AM UTC-8, Rolf Sommerhalder wrote:
Hello,

On Monday, July 20, 2015 at 6:57:35 PM UTC+2, Craig Tiller wrote:
It's something that's certainly interesting for us, but it's not something we've had the bandwidth to tackle properly yet.

Was there any progress on plain old, pure C API support in gPRC since summer 2015?


Not from gRPC team, but there is https://github.com/juniper/grpc-c which aims to provide a high level C API. Still in the works though. Should have this in beta in a month or two.

Thanks,
Ajay

Anirudh Kasturi

unread,
Mar 9, 2017, 2:05:16 PM3/9/17
to grpc.io
Just a quick approach. I had my API written in C++.  Then went ahead and wrote C wrapper functions for the C++ functions so that my C code can call them.  I created static libraries with the C++ object files and the wrapper .cc files' object files and included them in my C make file. Was good to go. Works perfectly.

sanke...@gmail.com

unread,
Jun 27, 2018, 7:51:22 PM6/27/18
to grpc.io
I am working on something similar. However being completely unfamiliar in the territory, I was wondering if you would have any material that I can refer to.

yonggang chang

unread,
Apr 14, 2022, 5:50:22 AM4/14/22
to grpc.io
Which approach did you choose?
Reply all
Reply to author
Forward
0 new messages