OLD | NEW |
(Empty) | |
| 1 #gRPC in 3 minutes (C++) |
| 2 |
| 3 ## Installation |
| 4 |
| 5 To install gRPC on your system, follow the instructions to build from source [he
re](../../INSTALL.md). This also installs the protocol buffer compiler `protoc`
(if you don't have it already), and the C++ gRPC plugin for `protoc`. |
| 6 |
| 7 ## Hello C++ gRPC! |
| 8 |
| 9 Here's how to build and run the C++ implementation of the [Hello World](../proto
s/helloworld.proto) example used in [Getting started](..). |
| 10 |
| 11 The example code for this and our other examples lives in the `examples` |
| 12 directory. Clone this repository to your local machine by running the |
| 13 following command: |
| 14 |
| 15 |
| 16 ```sh |
| 17 $ git clone https://github.com/grpc/grpc.git |
| 18 ``` |
| 19 |
| 20 Change your current directory to examples/cpp/helloworld |
| 21 |
| 22 ```sh |
| 23 $ cd examples/cpp/helloworld/ |
| 24 ``` |
| 25 |
| 26 ### Client and server implementations |
| 27 |
| 28 The client implementation is at [greeter_client.cc](helloworld/greeter_client.cc
). |
| 29 |
| 30 The server implementation is at [greeter_server.cc](helloworld/greeter_server.cc
). |
| 31 |
| 32 ### Try it! |
| 33 Build client and server: |
| 34 ```sh |
| 35 $ make |
| 36 ``` |
| 37 Run the server, which will listen on port 50051: |
| 38 ```sh |
| 39 $ ./greeter_server |
| 40 ``` |
| 41 Run the client (in a different terminal): |
| 42 ```sh |
| 43 $ ./greeter_client |
| 44 ``` |
| 45 If things go smoothly, you will see the "Greeter received: Hello world" in the c
lient side output. |
| 46 |
| 47 ## Tutorial |
| 48 |
| 49 You can find a more detailed tutorial in [gRPC Basics: C++](cpptutorial.md) |
OLD | NEW |