From 3054eba891802f7c48de16240ac1296fb1411e44 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Tue, 24 Feb 2015 14:36:18 -0800 Subject: [PATCH 1/3] Fix readme --- cpp/README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cpp/README.md b/cpp/README.md index fe9b71620e7..ac4dea9b7fd 100644 --- a/cpp/README.md +++ b/cpp/README.md @@ -35,7 +35,7 @@ $ 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 +$ protoc -I ../../protos/ --cpp_out=. --grpc_out=. --plugin=protoc-gen-grpc=grpc_cpp_plugin ../../protos/helloworld.proto ``` ### Client and server implementations @@ -45,8 +45,18 @@ The client implementation is at [greeter_client.cc](https://github.com/grpc/grpc The server implementation is at [greeter_server.cc](https://github.com/grpc/grpc-common/blob/master/cpp/helloworld/greeter_server.cc). ### Try it! - -###TODO: instructions to run server and client +Build client and server: +```sh +$ make +``` +Run the server: +```sh +$ ./greeter_server +``` +Run the client: +```sh +$ ./greeter_client +``` ## Tutorial From ecee424a879d0e56e7bd7115a7015beafe09c4e6 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Tue, 24 Feb 2015 14:46:53 -0800 Subject: [PATCH 2/3] Add output piece. --- cpp/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/README.md b/cpp/README.md index ac4dea9b7fd..078021d8760 100644 --- a/cpp/README.md +++ b/cpp/README.md @@ -53,10 +53,11 @@ Run the server: ```sh $ ./greeter_server ``` -Run the client: +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. ## Tutorial From 84c263fd720090c1b5018068caf4c61f40cb0605 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Tue, 24 Feb 2015 14:47:47 -0800 Subject: [PATCH 3/3] Add port info. --- cpp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/README.md b/cpp/README.md index 078021d8760..759e10bfe1f 100644 --- a/cpp/README.md +++ b/cpp/README.md @@ -49,7 +49,7 @@ Build client and server: ```sh $ make ``` -Run the server: +Run the server, which will listen on port 50051: ```sh $ ./greeter_server ```