Skip to content

Commit

Permalink
Merge pull request grpc#7688 from dgquintas/cpp_readme
Browse files Browse the repository at this point in the history
fix c++ readme and tutorial
  • Loading branch information
dgquintas authored Aug 11, 2016
2 parents 857b957 + 260a002 commit 93b599c
Show file tree
Hide file tree
Showing 2 changed files with 243 additions and 125 deletions.
31 changes: 13 additions & 18 deletions examples/cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,14 @@

## Installation

To install gRPC on your system, follow the instructions to build from source [here](../../INSTALL.md). This also installs the protocol buffer compiler `protoc` (if you don't have it already), and the C++ gRPC plugin for `protoc`.
To install gRPC on your system, follow the instructions to build from source
[here](../../INSTALL.md). This also installs the protocol buffer compiler
`protoc` (if you don't have it already), and the C++ gRPC plugin for `protoc`.

## Hello C++ gRPC!

Here's how to build and run the C++ implementation of the [Hello World](../protos/helloworld.proto) example used in [Getting started](..).

The example code for this and our other examples lives in the `examples`
directory. Clone this repository to your local machine by running the
following command:


```sh
$ git clone -b $(curl -L http://grpc.io/release) https://github.com/grpc/grpc
```

Change your current directory to examples/cpp/helloworld

```sh
$ cd examples/cpp/helloworld/
```
Here's how to build and run the C++ implementation of the [Hello
World](../protos/helloworld.proto) example used in [Getting started](..).

### Client and server implementations

Expand All @@ -31,18 +19,25 @@ The server implementation is at [greeter_server.cc](helloworld/greeter_server.cc

### Try it!
Build client and server:

```sh
$ make
```

Run the server, which will listen on port 50051:

```sh
$ ./greeter_server
```

Run the client (in a different terminal):

```sh
$ ./greeter_client
```
If things go smoothly, you will see the "Greeter received: Hello world" in the client side output.

If things go smoothly, you will see the "Greeter received: Hello world" in the
client side output.

## Tutorial

Expand Down
Loading

0 comments on commit 93b599c

Please sign in to comment.