The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) https://grpc.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.5 KiB

10 years ago
#gRPC in 3 minutes (C++)
10 years ago
## Installation
10 years ago
10 years ago
To install gRPC on your system, follow the instructions here:
10 years ago
[https://github.com/grpc/grpc/blob/master/INSTALL](https://github.com/grpc/grpc/blob/master/INSTALL).
10 years ago
## Hello C++ gRPC!
Here's how to build and run the C++ implementation of the [Hello World](https://github.com/grpc/grpc-common/blob/master/protos/helloworld.proto) example used in [Getting started](https://github.com/grpc/grpc-common).
10 years ago
The example code for this and our other examples lives in the `grpc-common`
GitHub repository. Clone this repository to your local machine by running the
following command:
```sh
$ git clone https://github.com/google/grpc-common.git
```
Change your current directory to grpc-common/cpp/helloworld
```sh
$ cd grpc-common/cpp/helloworld/
```
### Generating gRPC code
To generate the client and server side interfaces:
```sh
$ make helloworld.pb.cc
```
Which internally invokes the proto-compiler as:
```sh
$protoc -I ../../protos/ --cpp_out=. --grpc_out=. --plugin=protoc-gen-grpc=grpc_cpp_plugin helloworld.proto
```
10 years ago
### Client and server implementations
The client implementation is at [greeter_client.cc](https://github.com/grpc/grpc-common/blob/master/cpp/helloworld/greeter_client.cc).
The server implementation is at [greeter_server.cc](https://github.com/grpc/grpc-common/blob/master/cpp/helloworld/greeter_server.cc).
10 years ago
10 years ago
### Try it!
10 years ago
10 years ago
###TODO: instructions to run server and client
10 years ago
10 years ago
## Tutorial
10 years ago
You can find a more detailed tutorial in [gRPC Basics: C++](https://github.com/grpc/grpc-common/blob/master/cpp/cpptutorial.md)