Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkerou committed May 5, 2016
2 parents baf28f5 + 5a5dafa commit 806c0d6
Show file tree
Hide file tree
Showing 137 changed files with 3,162 additions and 1,255 deletions.
5 changes: 5 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ cc_library(
"include/grpc/grpc.h",
"include/grpc/status.h",
"include/grpc/impl/codegen/byte_buffer.h",
"include/grpc/impl/codegen/byte_buffer_reader.h",
"include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h",
"include/grpc/impl/codegen/grpc_types.h",
Expand Down Expand Up @@ -774,6 +775,7 @@ cc_library(
"include/grpc/grpc.h",
"include/grpc/status.h",
"include/grpc/impl/codegen/byte_buffer.h",
"include/grpc/impl/codegen/byte_buffer_reader.h",
"include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h",
"include/grpc/impl/codegen/grpc_types.h",
Expand Down Expand Up @@ -946,6 +948,7 @@ cc_library(
"include/grpc++/impl/codegen/sync_stream.h",
"include/grpc++/impl/codegen/time.h",
"include/grpc/impl/codegen/byte_buffer.h",
"include/grpc/impl/codegen/byte_buffer_reader.h",
"include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h",
"include/grpc/impl/codegen/grpc_types.h",
Expand Down Expand Up @@ -1091,6 +1094,7 @@ cc_library(
"include/grpc++/impl/codegen/sync_stream.h",
"include/grpc++/impl/codegen/time.h",
"include/grpc/impl/codegen/byte_buffer.h",
"include/grpc/impl/codegen/byte_buffer_reader.h",
"include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h",
"include/grpc/impl/codegen/grpc_types.h",
Expand Down Expand Up @@ -1480,6 +1484,7 @@ objc_library(
"include/grpc/grpc.h",
"include/grpc/status.h",
"include/grpc/impl/codegen/byte_buffer.h",
"include/grpc/impl/codegen/byte_buffer_reader.h",
"include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h",
"include/grpc/impl/codegen/grpc_types.h",
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2650,6 +2650,7 @@ PUBLIC_HEADERS_C += \
include/grpc/grpc.h \
include/grpc/status.h \
include/grpc/impl/codegen/byte_buffer.h \
include/grpc/impl/codegen/byte_buffer_reader.h \
include/grpc/impl/codegen/compression_types.h \
include/grpc/impl/codegen/connectivity_state.h \
include/grpc/impl/codegen/grpc_types.h \
Expand Down Expand Up @@ -2970,6 +2971,7 @@ PUBLIC_HEADERS_C += \
include/grpc/grpc.h \
include/grpc/status.h \
include/grpc/impl/codegen/byte_buffer.h \
include/grpc/impl/codegen/byte_buffer_reader.h \
include/grpc/impl/codegen/compression_types.h \
include/grpc/impl/codegen/connectivity_state.h \
include/grpc/impl/codegen/grpc_types.h \
Expand Down Expand Up @@ -3256,6 +3258,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/impl/codegen/sync_stream.h \
include/grpc++/impl/codegen/time.h \
include/grpc/impl/codegen/byte_buffer.h \
include/grpc/impl/codegen/byte_buffer_reader.h \
include/grpc/impl/codegen/compression_types.h \
include/grpc/impl/codegen/connectivity_state.h \
include/grpc/impl/codegen/grpc_types.h \
Expand Down Expand Up @@ -3559,6 +3562,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/impl/codegen/sync_stream.h \
include/grpc++/impl/codegen/time.h \
include/grpc/impl/codegen/byte_buffer.h \
include/grpc/impl/codegen/byte_buffer_reader.h \
include/grpc/impl/codegen/compression_types.h \
include/grpc/impl/codegen/connectivity_state.h \
include/grpc/impl/codegen/grpc_types.h \
Expand Down
1 change: 1 addition & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ filegroups:
- name: grpc_codegen
public_headers:
- include/grpc/impl/codegen/byte_buffer.h
- include/grpc/impl/codegen/byte_buffer_reader.h
- include/grpc/impl/codegen/compression_types.h
- include/grpc/impl/codegen/connectivity_state.h
- include/grpc/impl/codegen/grpc_types.h
Expand Down
22 changes: 7 additions & 15 deletions examples/node/greeter_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,22 @@
*
*/

var grpc = require('grpc');
var PROTO_PATH = __dirname + '/../protos/helloworld.proto';

var hello_messages = require('./helloworld_pb');
var hello_service = require('./helloworld_grpc_pb');
var grpc = require('grpc');
var hello_proto = grpc.load(PROTO_PATH).helloworld;

function main() {
var client = new hello_service.GreeterClient('localhost:50051',
grpc.credentials.createInsecure());
var client = new hello_proto.Greeter('localhost:50051',
grpc.credentials.createInsecure());
var user;
if (process.argv.length >= 3) {
user = process.argv[2];
} else {
user = 'world';
}

var request = new hello_messages.HelloRequest();
request.setName(user);

client.sayHello(request, function(err, response) {
if (err) {
debugger;
throw err;
}
console.log('Greeting:', response.getMessage());
client.sayHello({name: user}, function(err, response) {
console.log('Greeting:', response.message);
});
}

Expand Down
12 changes: 5 additions & 7 deletions examples/node/greeter_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,16 @@
*
*/

var grpc = require('grpc');
var PROTO_PATH = __dirname + '/../protos/helloworld.proto';

var hello_messages = require('./helloworld_pb');
var hello_service = require('./helloworld_grpc_pb');
var grpc = require('grpc');
var hello_proto = grpc.load(PROTO_PATH).helloworld;

/**
* Implements the SayHello RPC method.
*/
function sayHello(call, callback) {
var reply = new hello_messages.HelloReply();
reply.setMessage("Hello " + call.request.getName());
callback(null, reply);
callback(null, {message: 'Hello ' + call.request.name});
}

/**
Expand All @@ -51,7 +49,7 @@ function sayHello(call, callback) {
*/
function main() {
var server = new grpc.Server();
server.addService(hello_service.GreeterService, {sayHello: sayHello});
server.addProtoService(hello_proto.Greeter.service, {sayHello: sayHello});
server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
server.start();
}
Expand Down
39 changes: 0 additions & 39 deletions examples/node/helloworld_grpc_pb.js

This file was deleted.

Loading

0 comments on commit 806c0d6

Please sign in to comment.