From cc357bf74e27888a354f361ad3b66e4e2b565dbc Mon Sep 17 00:00:00 2001 From: Sree Kuchibhotla Date: Mon, 22 Aug 2016 16:08:50 -0700 Subject: Remove completion queue parameter from grpc_server_add_insecure_channel_from_fd API --- src/cpp/server/server_posix.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/cpp') diff --git a/src/cpp/server/server_posix.cc b/src/cpp/server/server_posix.cc index c3aa2adc60..33d42a8dc7 100644 --- a/src/cpp/server/server_posix.cc +++ b/src/cpp/server/server_posix.cc @@ -40,8 +40,7 @@ namespace grpc { #ifdef GPR_SUPPORT_CHANNELS_FROM_FD void AddInsecureChannelFromFd(Server* server, int fd) { - grpc_server_add_insecure_channel_from_fd( - server->c_server(), server->completion_queue()->cq(), fd); + grpc_server_add_insecure_channel_from_fd(server->c_server(), NULL, fd); } #endif // GPR_SUPPORT_CHANNELS_FROM_FD -- cgit v1.2.3 From 509ee4c11127700986ceb05c020d2ceef5667852 Mon Sep 17 00:00:00 2001 From: Sree Kuchibhotla Date: Mon, 22 Aug 2016 17:48:41 -0700 Subject: Remove the API to return the underlying completion queue. This API is no longer needed --- include/grpc++/server.h | 3 --- src/cpp/server/server.cc | 2 -- 2 files changed, 5 deletions(-) (limited to 'src/cpp') diff --git a/include/grpc++/server.h b/include/grpc++/server.h index 6876961e21..87536edbe8 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -96,9 +96,6 @@ class Server GRPC_FINAL : public ServerInterface, private GrpcLibraryCodegen { // Returns a \em raw pointer to the underlying grpc_server instance. grpc_server* c_server(); - // Returns a \em raw pointer to the underlying CompletionQueue. - CompletionQueue* completion_queue(); - private: friend class AsyncGenericService; friend class ServerBuilder; diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index af04fd4ca6..0effa9f125 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -332,8 +332,6 @@ void Server::SetGlobalCallbacks(GlobalCallbacks* callbacks) { grpc_server* Server::c_server() { return server_; } -CompletionQueue* Server::completion_queue() { return &cq_; } - static grpc_server_register_method_payload_handling PayloadHandlingForMethod( RpcServiceMethod* method) { switch (method->method_type()) { -- cgit v1.2.3 From dbdc6e4ae619225a555849569f04af5575a5f99f Mon Sep 17 00:00:00 2001 From: Adam Czachorowski Date: Fri, 9 Sep 2016 11:32:09 +0200 Subject: Add method for creating insecure channel from FD with custom arguments using C++ API. This was already supported in C API. --- include/grpc++/create_channel_posix.h | 10 ++++++++++ src/cpp/client/create_channel_posix.cc | 10 ++++++++++ 2 files changed, 20 insertions(+) (limited to 'src/cpp') diff --git a/include/grpc++/create_channel_posix.h b/include/grpc++/create_channel_posix.h index 0d96159942..2af12e6c36 100644 --- a/include/grpc++/create_channel_posix.h +++ b/include/grpc++/create_channel_posix.h @@ -37,6 +37,7 @@ #include #include +#include #include namespace grpc { @@ -50,6 +51,15 @@ namespace grpc { std::shared_ptr CreateInsecureChannelFromFd(const grpc::string& target, int fd); +/// Create a new \a Channel communicating over given file descriptor with custom +/// channel arguments +/// +/// \param target The name of the target. +/// \param fd The file descriptor representing a socket. +/// \param args Options for channel creation. +std::shared_ptr CreateCustomInsecureChannelFromFd( + const grpc::string& target, int fd, const ChannelArguments& args); + #endif // GPR_SUPPORT_CHANNELS_FROM_FD } // namespace grpc diff --git a/src/cpp/client/create_channel_posix.cc b/src/cpp/client/create_channel_posix.cc index 60cfed3d62..eb323ac50b 100644 --- a/src/cpp/client/create_channel_posix.cc +++ b/src/cpp/client/create_channel_posix.cc @@ -51,6 +51,16 @@ std::shared_ptr CreateInsecureChannelFromFd(const grpc::string& target, "", grpc_insecure_channel_create_from_fd(target.c_str(), fd, nullptr)); } +std::shared_ptr CreateCustomInsecureChannelFromFd( + const grpc::string& target, int fd, const ChannelArguments& args) { + internal::GrpcLibrary init_lib; + init_lib.init(); + grpc_channel_args channel_args; + args.SetChannelArgs(&channel_args); + return CreateChannelInternal("", grpc_insecure_channel_create_from_fd( + target.c_str(), fd, &channel_args)); +} + #endif // GPR_SUPPORT_CHANNELS_FROM_FD } // namespace grpc -- cgit v1.2.3 From 27e96f9beb04084686b179ee65503d6a7f8ad1b7 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Thu, 22 Sep 2016 20:56:46 -0700 Subject: Add comments about how to re-generate reflection proto files --- include/grpc++/ext/reflection.grpc.pb.h | 2 +- include/grpc++/ext/reflection.pb.h | 2 +- src/cpp/ext/reflection.grpc.pb.cc | 2 +- src/cpp/ext/reflection.pb.cc | 2 +- tools/codegen/extensions/gen_reflection_proto.sh | 3 +++ 5 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/cpp') diff --git a/include/grpc++/ext/reflection.grpc.pb.h b/include/grpc++/ext/reflection.grpc.pb.h index 064117e303..f95ffd6a35 100644 --- a/include/grpc++/ext/reflection.grpc.pb.h +++ b/include/grpc++/ext/reflection.grpc.pb.h @@ -32,7 +32,7 @@ */ -// Generated by the gRPC protobuf plugin. +// Generated by tools/codegen/extensions/gen_refelction_proto.sh // If you make any local change, they will be lost. // source: reflection.proto // Original file comments: diff --git a/include/grpc++/ext/reflection.pb.h b/include/grpc++/ext/reflection.pb.h index bdb86197d0..5821b0d5ae 100644 --- a/include/grpc++/ext/reflection.pb.h +++ b/include/grpc++/ext/reflection.pb.h @@ -32,7 +32,7 @@ */ -// Generated by the protocol buffer compiler. DO NOT EDIT! +// Generated by tools/codegen/extensions/gen_refelction_proto.sh // source: reflection.proto #ifndef PROTOBUF_reflection_2eproto__INCLUDED diff --git a/src/cpp/ext/reflection.grpc.pb.cc b/src/cpp/ext/reflection.grpc.pb.cc index b046dfc1b8..b107b29b4a 100644 --- a/src/cpp/ext/reflection.grpc.pb.cc +++ b/src/cpp/ext/reflection.grpc.pb.cc @@ -32,7 +32,7 @@ */ -// Generated by the gRPC protobuf plugin. +// Generated by tools/codegen/extensions/gen_refelction_proto.sh // If you make any local change, they will be lost. // source: reflection.proto diff --git a/src/cpp/ext/reflection.pb.cc b/src/cpp/ext/reflection.pb.cc index a84494f9a9..a27cb275be 100644 --- a/src/cpp/ext/reflection.pb.cc +++ b/src/cpp/ext/reflection.pb.cc @@ -32,7 +32,7 @@ */ -// Generated by the protocol buffer compiler. DO NOT EDIT! +// Generated by tools/codegen/extensions/gen_refelction_proto.sh // source: reflection.proto #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION diff --git a/tools/codegen/extensions/gen_reflection_proto.sh b/tools/codegen/extensions/gen_reflection_proto.sh index bd8aac6a7b..d55272803f 100755 --- a/tools/codegen/extensions/gen_reflection_proto.sh +++ b/tools/codegen/extensions/gen_reflection_proto.sh @@ -56,6 +56,9 @@ sed -i "s/\"${PROTO_FILE}.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.pb.h>/g" sed -i "s/\"${PROTO_FILE}.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.pb.h>/g" ${TMP_DIR}/${PROTO_FILE}.grpc.pb.cc sed -i "s/\"${PROTO_FILE}.grpc.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.grpc.pb.h>/g" ${TMP_DIR}/${PROTO_FILE}.grpc.pb.cc +sed -i "1s/.*/\/\/ Generated by tools\/codegen\/extensions\/gen_refelction_proto.sh/g" ${TMP_DIR}/*.pb.h +sed -i "1s/.*/\/\/ Generated by tools\/codegen\/extensions\/gen_refelction_proto.sh/g" ${TMP_DIR}/*.pb.cc + /bin/cp LICENSE ${TMP_DIR}/TMP_LICENSE sed -i -e "s/./ &/" -e "s/.*/ \*&/" ${TMP_DIR}/TMP_LICENSE sed -i -r "\$a\ *\n *\/\n\n" ${TMP_DIR}/TMP_LICENSE -- cgit v1.2.3 From ef394a954a326f42bf236f2db49fcfd84f50339b Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Fri, 23 Sep 2016 14:04:33 -0700 Subject: Fix typo --- include/grpc++/ext/reflection.grpc.pb.h | 2 +- include/grpc++/ext/reflection.pb.h | 2 +- src/cpp/ext/reflection.grpc.pb.cc | 2 +- src/cpp/ext/reflection.pb.cc | 2 +- tools/codegen/extensions/gen_reflection_proto.sh | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/cpp') diff --git a/include/grpc++/ext/reflection.grpc.pb.h b/include/grpc++/ext/reflection.grpc.pb.h index f95ffd6a35..6e56088497 100644 --- a/include/grpc++/ext/reflection.grpc.pb.h +++ b/include/grpc++/ext/reflection.grpc.pb.h @@ -32,7 +32,7 @@ */ -// Generated by tools/codegen/extensions/gen_refelction_proto.sh +// Generated by tools/codegen/extensions/gen_reflection_proto.sh // If you make any local change, they will be lost. // source: reflection.proto // Original file comments: diff --git a/include/grpc++/ext/reflection.pb.h b/include/grpc++/ext/reflection.pb.h index 5821b0d5ae..caa1592424 100644 --- a/include/grpc++/ext/reflection.pb.h +++ b/include/grpc++/ext/reflection.pb.h @@ -32,7 +32,7 @@ */ -// Generated by tools/codegen/extensions/gen_refelction_proto.sh +// Generated by tools/codegen/extensions/gen_reflection_proto.sh // source: reflection.proto #ifndef PROTOBUF_reflection_2eproto__INCLUDED diff --git a/src/cpp/ext/reflection.grpc.pb.cc b/src/cpp/ext/reflection.grpc.pb.cc index b107b29b4a..8139c8ea16 100644 --- a/src/cpp/ext/reflection.grpc.pb.cc +++ b/src/cpp/ext/reflection.grpc.pb.cc @@ -32,7 +32,7 @@ */ -// Generated by tools/codegen/extensions/gen_refelction_proto.sh +// Generated by tools/codegen/extensions/gen_reflection_proto.sh // If you make any local change, they will be lost. // source: reflection.proto diff --git a/src/cpp/ext/reflection.pb.cc b/src/cpp/ext/reflection.pb.cc index a27cb275be..b50465b9b5 100644 --- a/src/cpp/ext/reflection.pb.cc +++ b/src/cpp/ext/reflection.pb.cc @@ -32,7 +32,7 @@ */ -// Generated by tools/codegen/extensions/gen_refelction_proto.sh +// Generated by tools/codegen/extensions/gen_reflection_proto.sh // source: reflection.proto #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION diff --git a/tools/codegen/extensions/gen_reflection_proto.sh b/tools/codegen/extensions/gen_reflection_proto.sh index db997556ec..ea7689f7e8 100755 --- a/tools/codegen/extensions/gen_reflection_proto.sh +++ b/tools/codegen/extensions/gen_reflection_proto.sh @@ -75,8 +75,8 @@ sed -i "s/\"${PROTO_FILE}.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.pb.h>/g" sed -i "s/\"${PROTO_FILE}.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.pb.h>/g" ${TMP_DIR}/${PROTO_FILE}.grpc.pb.cc sed -i "s/\"${PROTO_FILE}.grpc.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.grpc.pb.h>/g" ${TMP_DIR}/${PROTO_FILE}.grpc.pb.cc -sed -i "1s/.*/\/\/ Generated by tools\/codegen\/extensions\/gen_refelction_proto.sh/g" ${TMP_DIR}/*.pb.h -sed -i "1s/.*/\/\/ Generated by tools\/codegen\/extensions\/gen_refelction_proto.sh/g" ${TMP_DIR}/*.pb.cc +sed -i "1s/.*/\/\/ Generated by tools\/codegen\/extensions\/gen_reflection_proto.sh/g" ${TMP_DIR}/*.pb.h +sed -i "1s/.*/\/\/ Generated by tools\/codegen\/extensions\/gen_reflection_proto.sh/g" ${TMP_DIR}/*.pb.cc /bin/cp LICENSE ${TMP_DIR}/TMP_LICENSE sed -i -e "s/./ &/" -e "s/.*/ \*&/" ${TMP_DIR}/TMP_LICENSE -- cgit v1.2.3