aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--BUILD5
-rw-r--r--Makefile6
-rw-r--r--build.yaml2
-rw-r--r--include/grpc++/ext/reflection.grpc.pb.h2
-rw-r--r--include/grpc++/impl/codegen/call.h6
-rw-r--r--include/grpc++/impl/codegen/completion_queue.h8
-rw-r--r--include/grpc++/impl/codegen/fc_unary.h99
-rw-r--r--include/grpc++/impl/codegen/method_handler_impl.h35
-rw-r--r--include/grpc++/impl/codegen/rpc_method.h6
-rw-r--r--include/grpc++/impl/codegen/rpc_service_method.h1
-rw-r--r--include/grpc++/impl/codegen/server_context.h8
-rw-r--r--include/grpc++/impl/codegen/service_type.h7
-rw-r--r--include/grpc++/impl/codegen/sync_stream.h11
-rw-r--r--include/grpc++/support/fc_unary.h39
-rw-r--r--src/compiler/cpp_generator.cc59
-rw-r--r--src/cpp/ext/reflection.grpc.pb.cc1
-rw-r--r--src/cpp/server/server.cc1
-rw-r--r--test/cpp/codegen/compiler_test_golden42
-rw-r--r--test/cpp/end2end/hybrid_end2end_test.cc39
-rw-r--r--test/cpp/end2end/mock_test.cc3
-rw-r--r--tools/doxygen/Doxyfile.c++2
-rw-r--r--tools/doxygen/Doxyfile.c++.internal2
-rw-r--r--tools/run_tests/sources_and_headers.json4
-rw-r--r--vsprojects/vcxproj/grpc++/grpc++.vcxproj2
-rw-r--r--vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters6
-rw-r--r--vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj1
-rw-r--r--vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj.filters3
-rw-r--r--vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj1
-rw-r--r--vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters3
-rw-r--r--vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj2
-rw-r--r--vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters6
-rw-r--r--vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj1
-rw-r--r--vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj.filters3
-rw-r--r--vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj1
-rw-r--r--vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj.filters3
35 files changed, 414 insertions, 6 deletions
diff --git a/BUILD b/BUILD
index 33323be229..de703437b0 100644
--- a/BUILD
+++ b/BUILD
@@ -1310,6 +1310,7 @@ cc_library(
"include/grpc++/support/byte_buffer.h",
"include/grpc++/support/channel_arguments.h",
"include/grpc++/support/config.h",
+ "include/grpc++/support/fc_unary.h",
"include/grpc++/support/slice.h",
"include/grpc++/support/status.h",
"include/grpc++/support/status_code_enum.h",
@@ -1329,6 +1330,7 @@ cc_library(
"include/grpc++/impl/codegen/config.h",
"include/grpc++/impl/codegen/core_codegen_interface.h",
"include/grpc++/impl/codegen/create_auth_context.h",
+ "include/grpc++/impl/codegen/fc_unary.h",
"include/grpc++/impl/codegen/grpc_library.h",
"include/grpc++/impl/codegen/method_handler_impl.h",
"include/grpc++/impl/codegen/rpc_method.h",
@@ -1408,6 +1410,7 @@ cc_library(
"include/grpc++/impl/codegen/config.h",
"include/grpc++/impl/codegen/core_codegen_interface.h",
"include/grpc++/impl/codegen/create_auth_context.h",
+ "include/grpc++/impl/codegen/fc_unary.h",
"include/grpc++/impl/codegen/grpc_library.h",
"include/grpc++/impl/codegen/method_handler_impl.h",
"include/grpc++/impl/codegen/rpc_method.h",
@@ -1536,6 +1539,7 @@ cc_library(
"include/grpc++/support/byte_buffer.h",
"include/grpc++/support/channel_arguments.h",
"include/grpc++/support/config.h",
+ "include/grpc++/support/fc_unary.h",
"include/grpc++/support/slice.h",
"include/grpc++/support/status.h",
"include/grpc++/support/status_code_enum.h",
@@ -1555,6 +1559,7 @@ cc_library(
"include/grpc++/impl/codegen/config.h",
"include/grpc++/impl/codegen/core_codegen_interface.h",
"include/grpc++/impl/codegen/create_auth_context.h",
+ "include/grpc++/impl/codegen/fc_unary.h",
"include/grpc++/impl/codegen/grpc_library.h",
"include/grpc++/impl/codegen/method_handler_impl.h",
"include/grpc++/impl/codegen/rpc_method.h",
diff --git a/Makefile b/Makefile
index 4ce22678d7..648c27b9dd 100644
--- a/Makefile
+++ b/Makefile
@@ -3460,6 +3460,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/support/byte_buffer.h \
include/grpc++/support/channel_arguments.h \
include/grpc++/support/config.h \
+ include/grpc++/support/fc_unary.h \
include/grpc++/support/slice.h \
include/grpc++/support/status.h \
include/grpc++/support/status_code_enum.h \
@@ -3479,6 +3480,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/impl/codegen/config.h \
include/grpc++/impl/codegen/core_codegen_interface.h \
include/grpc++/impl/codegen/create_auth_context.h \
+ include/grpc++/impl/codegen/fc_unary.h \
include/grpc++/impl/codegen/grpc_library.h \
include/grpc++/impl/codegen/method_handler_impl.h \
include/grpc++/impl/codegen/rpc_method.h \
@@ -3605,6 +3607,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/impl/codegen/config.h \
include/grpc++/impl/codegen/core_codegen_interface.h \
include/grpc++/impl/codegen/create_auth_context.h \
+ include/grpc++/impl/codegen/fc_unary.h \
include/grpc++/impl/codegen/grpc_library.h \
include/grpc++/impl/codegen/method_handler_impl.h \
include/grpc++/impl/codegen/rpc_method.h \
@@ -3783,6 +3786,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/impl/codegen/config.h \
include/grpc++/impl/codegen/core_codegen_interface.h \
include/grpc++/impl/codegen/create_auth_context.h \
+ include/grpc++/impl/codegen/fc_unary.h \
include/grpc++/impl/codegen/grpc_library.h \
include/grpc++/impl/codegen/method_handler_impl.h \
include/grpc++/impl/codegen/rpc_method.h \
@@ -3947,6 +3951,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/support/byte_buffer.h \
include/grpc++/support/channel_arguments.h \
include/grpc++/support/config.h \
+ include/grpc++/support/fc_unary.h \
include/grpc++/support/slice.h \
include/grpc++/support/status.h \
include/grpc++/support/status_code_enum.h \
@@ -3966,6 +3971,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/impl/codegen/config.h \
include/grpc++/impl/codegen/core_codegen_interface.h \
include/grpc++/impl/codegen/create_auth_context.h \
+ include/grpc++/impl/codegen/fc_unary.h \
include/grpc++/impl/codegen/grpc_library.h \
include/grpc++/impl/codegen/method_handler_impl.h \
include/grpc++/impl/codegen/rpc_method.h \
diff --git a/build.yaml b/build.yaml
index 57545839d4..1da0d8f0bb 100644
--- a/build.yaml
+++ b/build.yaml
@@ -674,6 +674,7 @@ filegroups:
- include/grpc++/support/byte_buffer.h
- include/grpc++/support/channel_arguments.h
- include/grpc++/support/config.h
+ - include/grpc++/support/fc_unary.h
- include/grpc++/support/slice.h
- include/grpc++/support/status.h
- include/grpc++/support/status_code_enum.h
@@ -731,6 +732,7 @@ filegroups:
- include/grpc++/impl/codegen/config.h
- include/grpc++/impl/codegen/core_codegen_interface.h
- include/grpc++/impl/codegen/create_auth_context.h
+ - include/grpc++/impl/codegen/fc_unary.h
- include/grpc++/impl/codegen/grpc_library.h
- include/grpc++/impl/codegen/method_handler_impl.h
- include/grpc++/impl/codegen/rpc_method.h
diff --git a/include/grpc++/ext/reflection.grpc.pb.h b/include/grpc++/ext/reflection.grpc.pb.h
index 0b4ef86147..74e1d389d2 100644
--- a/include/grpc++/ext/reflection.grpc.pb.h
+++ b/include/grpc++/ext/reflection.grpc.pb.h
@@ -74,6 +74,8 @@
#include <grpc++/impl/codegen/async_stream.h>
#include <grpc++/impl/codegen/async_unary_call.h>
+#include <grpc++/impl/codegen/fc_unary.h>
+#include <grpc++/impl/codegen/method_handler_impl.h>
#include <grpc++/impl/codegen/proto_utils.h>
#include <grpc++/impl/codegen/rpc_method.h>
#include <grpc++/impl/codegen/service_type.h>
diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h
index fab85d1517..a9a5eb9f00 100644
--- a/include/grpc++/impl/codegen/call.h
+++ b/include/grpc++/impl/codegen/call.h
@@ -656,10 +656,10 @@ class Call GRPC_FINAL {
call_hook_->PerformOpsOnCall(ops, this);
}
- grpc_call* call() { return call_; }
- CompletionQueue* cq() { return cq_; }
+ grpc_call* call() const { return call_; }
+ CompletionQueue* cq() const { return cq_; }
- int max_message_size() { return max_message_size_; }
+ int max_message_size() const { return max_message_size_; }
private:
CallHook* call_hook_;
diff --git a/include/grpc++/impl/codegen/completion_queue.h b/include/grpc++/impl/codegen/completion_queue.h
index 03009e0561..1d00bf2d1b 100644
--- a/include/grpc++/impl/codegen/completion_queue.h
+++ b/include/grpc++/impl/codegen/completion_queue.h
@@ -70,6 +70,8 @@ template <class W>
class ServerWriter;
template <class W, class R>
class ServerReaderWriter;
+template <class Req, class Resp>
+class FCUnary;
template <class ServiceType, class RequestType, class ResponseType>
class RpcMethodHandler;
template <class ServiceType, class RequestType, class ResponseType>
@@ -78,6 +80,8 @@ template <class ServiceType, class RequestType, class ResponseType>
class ServerStreamingHandler;
template <class ServiceType, class RequestType, class ResponseType>
class BidiStreamingHandler;
+template <class ServiceType, class RequestType, class ResponseType>
+class FCUnaryMethodHandler;
class UnknownMethodHandler;
class Channel;
@@ -179,6 +183,8 @@ class CompletionQueue : private GrpcLibraryCodegen {
friend class ::grpc::ServerWriter;
template <class W, class R>
friend class ::grpc::ServerReaderWriter;
+ template <class Req, class Resp>
+ friend class ::grpc::FCUnary;
template <class ServiceType, class RequestType, class ResponseType>
friend class RpcMethodHandler;
template <class ServiceType, class RequestType, class ResponseType>
@@ -187,6 +193,8 @@ class CompletionQueue : private GrpcLibraryCodegen {
friend class ServerStreamingHandler;
template <class ServiceType, class RequestType, class ResponseType>
friend class BidiStreamingHandler;
+ template <class ServiceType, class RequestType, class ResponseType>
+ friend class FCUnaryMethodHandler;
friend class UnknownMethodHandler;
friend class ::grpc::Server;
friend class ::grpc::ServerContext;
diff --git a/include/grpc++/impl/codegen/fc_unary.h b/include/grpc++/impl/codegen/fc_unary.h
new file mode 100644
index 0000000000..22e40ab02e
--- /dev/null
+++ b/include/grpc++/impl/codegen/fc_unary.h
@@ -0,0 +1,99 @@
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPCXX_IMPL_CODEGEN_FC_UNARY_H
+#define GRPCXX_IMPL_CODEGEN_FC_UNARY_H
+
+#include <grpc++/impl/codegen/call.h>
+#include <grpc++/impl/codegen/completion_queue.h>
+#include <grpc++/impl/codegen/core_codegen_interface.h>
+#include <grpc++/impl/codegen/method_handler_impl.h>
+#include <grpc++/impl/codegen/server_context.h>
+
+namespace grpc {
+
+/// A class to represent a flow-controlled unary call. This is something
+/// of a hybrid between conventional unary and streaming. This is invoked
+/// through a unary call on the client side, but the server responds to it
+/// as though it were a single-ping-pong streaming call. The server can use
+/// the \a NextMessageSize method to determine an upper-bound on the size of
+/// the message.
+/// A key difference relative to streaming: an FCUnary must have exactly 1 Read
+/// and exactly 1 Write, in that order, to function correctly.
+/// Otherwise, the RPC is in error.
+template <class RequestType, class ResponseType>
+ class FCUnary GRPC_FINAL {
+ public:
+ FCUnary(Call* call, ServerContext* ctx): call_(call), ctx_(ctx), read_done_(false), write_done_(false) {}
+ ~FCUnary() {}
+ uint32_t NextMessageSize() {return call_->max_message_size();}
+ bool Read(RequestType *request) {
+ if (read_done_) {
+ return false;
+ }
+ read_done_ = true;
+ CallOpSet<CallOpRecvMessage<RequestType>> ops;
+ ops.RecvMessage(request);
+ call_->PerformOps(&ops);
+ return call_->cq()->Pluck(&ops) && ops.got_message;
+ }
+ bool Write(const ResponseType& response) {return Write(response, WriteOptions());}
+ bool Write(const ResponseType& response, const WriteOptions& options) {
+ if (write_done_ || !read_done_) {
+ return false;
+ }
+ write_done_ = true;
+ CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage> ops;
+ if (!ops.SendMessage(response, options).ok()) {
+ return false;
+ }
+ if (!ctx_->sent_initial_metadata_) {
+ ops.SendInitialMetadata(ctx_->initial_metadata_,
+ ctx_->initial_metadata_flags());
+ ctx_->sent_initial_metadata_ = true;
+ } else {
+ return false;
+ }
+ call_->PerformOps(&ops);
+ return call_->cq()->Pluck(&ops);
+ }
+ private:
+ Call* const call_;
+ ServerContext* const ctx_;
+ bool read_done_;
+ bool write_done_;
+};
+
+} // namespace grpc
+
+#endif // GRPCXX_IMPL_CODEGEN_FC_UNARY_H
diff --git a/include/grpc++/impl/codegen/method_handler_impl.h b/include/grpc++/impl/codegen/method_handler_impl.h
index 21ac6c4fb5..293ae6a4d8 100644
--- a/include/grpc++/impl/codegen/method_handler_impl.h
+++ b/include/grpc++/impl/codegen/method_handler_impl.h
@@ -35,6 +35,7 @@
#define GRPCXX_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H
#include <grpc++/impl/codegen/core_codegen_interface.h>
+#include <grpc++/impl/codegen/fc_unary.h>
#include <grpc++/impl/codegen/rpc_service_method.h>
#include <grpc++/impl/codegen/sync_stream.h>
@@ -190,6 +191,40 @@ class BidiStreamingHandler : public MethodHandler {
ServiceType* service_;
};
+// A wrapper class of an application provided rpc method handler
+// specifically to apply to the flow-controlled implementation of a unary
+// method.
+/// The argument to the constructor should be a member function already
+/// bound to the appropriate service instance. The declaration gets too complicated
+/// otherwise.
+template <class ServiceType, class RequestType, class ResponseType>
+class FCUnaryMethodHandler : public MethodHandler {
+ public:
+ FCUnaryMethodHandler(std::function<Status(ServerContext*,
+ FCUnary<RequestType,ResponseType>*)>
+ func)
+ : func_(func) {}
+
+ void RunHandler(const HandlerParameter& param) GRPC_FINAL {
+ FCUnary<RequestType, ResponseType> fc_unary(param.call,
+ param.server_context);
+ Status status = func_(param.server_context, &fc_unary);
+ if (!param.server_context->sent_initial_metadata_) {
+ // means that the write never happened, which is bad
+ } else {
+ CallOpSet<CallOpServerSendStatus> ops;
+ ops.ServerSendStatus(param.server_context->trailing_metadata_, status);
+ param.call->PerformOps(&ops);
+ param.call->cq()->Pluck(&ops);
+ }
+ }
+ private:
+ // Application provided rpc handler function, already bound to its service.
+ std::function<Status(ServerContext*,
+ FCUnary<RequestType, ResponseType>*)>
+ func_;
+};
+
// Handle unknown method by returning UNIMPLEMENTED error.
class UnknownMethodHandler : public MethodHandler {
public:
diff --git a/include/grpc++/impl/codegen/rpc_method.h b/include/grpc++/impl/codegen/rpc_method.h
index 39cb4f75df..728ba3e334 100644
--- a/include/grpc++/impl/codegen/rpc_method.h
+++ b/include/grpc++/impl/codegen/rpc_method.h
@@ -46,7 +46,8 @@ class RpcMethod {
NORMAL_RPC = 0,
CLIENT_STREAMING, // request streaming
SERVER_STREAMING, // response streaming
- BIDI_STREAMING
+ BIDI_STREAMING,
+ FC_UNARY // flow-controlled unary call
};
RpcMethod(const char* name, RpcType type)
@@ -60,11 +61,12 @@ class RpcMethod {
const char* name() const { return name_; }
RpcType method_type() const { return method_type_; }
+ void SetMethodType(RpcType type) { method_type_ = type; }
void* channel_tag() const { return channel_tag_; }
private:
const char* const name_;
- const RpcType method_type_;
+ RpcType method_type_;
void* const channel_tag_;
};
diff --git a/include/grpc++/impl/codegen/rpc_service_method.h b/include/grpc++/impl/codegen/rpc_service_method.h
index 8b1f026c91..02da2a2617 100644
--- a/include/grpc++/impl/codegen/rpc_service_method.h
+++ b/include/grpc++/impl/codegen/rpc_service_method.h
@@ -82,6 +82,7 @@ class RpcServiceMethod : public RpcMethod {
// if MethodHandler is nullptr, then this is an async method
MethodHandler* handler() const { return handler_.get(); }
void ResetHandler() { handler_.reset(); }
+ void SetHandler(MethodHandler *handler) { handler_.reset(handler); }
private:
void* server_tag_;
diff --git a/include/grpc++/impl/codegen/server_context.h b/include/grpc++/impl/codegen/server_context.h
index cea13a513f..cfd50aeafb 100644
--- a/include/grpc++/impl/codegen/server_context.h
+++ b/include/grpc++/impl/codegen/server_context.h
@@ -67,6 +67,8 @@ template <class W>
class ServerWriter;
template <class W, class R>
class ServerReaderWriter;
+template <class Req, class Resp>
+class FCUnary;
template <class ServiceType, class RequestType, class ResponseType>
class RpcMethodHandler;
template <class ServiceType, class RequestType, class ResponseType>
@@ -75,6 +77,8 @@ template <class ServiceType, class RequestType, class ResponseType>
class ServerStreamingHandler;
template <class ServiceType, class RequestType, class ResponseType>
class BidiStreamingHandler;
+template <class ServiceType, class RequestType, class ResponseType>
+class FCUnaryMethodHandler;
class UnknownMethodHandler;
class Call;
@@ -178,6 +182,8 @@ class ServerContext {
friend class ::grpc::ServerWriter;
template <class W, class R>
friend class ::grpc::ServerReaderWriter;
+ template <class Req, class Resp>
+ friend class ::grpc::FCUnary;
template <class ServiceType, class RequestType, class ResponseType>
friend class RpcMethodHandler;
template <class ServiceType, class RequestType, class ResponseType>
@@ -186,6 +192,8 @@ class ServerContext {
friend class ServerStreamingHandler;
template <class ServiceType, class RequestType, class ResponseType>
friend class BidiStreamingHandler;
+ template <class ServiceType, class RequestType, class ResponseType>
+ friend class FCUnaryMethodHandler;
friend class UnknownMethodHandler;
friend class ::grpc::ClientContext;
diff --git a/include/grpc++/impl/codegen/service_type.h b/include/grpc++/impl/codegen/service_type.h
index c19dfc7d45..c0eeace8a4 100644
--- a/include/grpc++/impl/codegen/service_type.h
+++ b/include/grpc++/impl/codegen/service_type.h
@@ -147,6 +147,13 @@ class Service {
methods_[index].reset();
}
+ void MarkMethodFCUnary(int index, MethodHandler* fc_unary_method) {
+ GPR_CODEGEN_ASSERT(methods_[index] && methods_[index]->handler() &&
+ "Cannot mark an async or generic method as FCUnary");
+ methods_[index]->SetMethodType(::grpc::RpcMethod::FC_UNARY);
+ methods_[index]->SetHandler(fc_unary_method);
+ }
+
private:
friend class Server;
friend class ServerInterface;
diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h
index cbfa410699..0afa8b6aa4 100644
--- a/include/grpc++/impl/codegen/sync_stream.h
+++ b/include/grpc++/impl/codegen/sync_stream.h
@@ -70,6 +70,9 @@ class ReaderInterface {
public:
virtual ~ReaderInterface() {}
+ /// Upper bound on the next message size available for reading on this stream
+ virtual uint32_t NextMessageSize() = 0;
+
/// Blocking read a message and parse to \a msg. Returns \a true on success.
/// This is thread-safe with respect to \a Write or \WritesDone methods on
/// the same stream. It should not be called concurrently with another \a
@@ -148,6 +151,8 @@ class ClientReader GRPC_FINAL : public ClientReaderInterface<R> {
cq_.Pluck(&ops); /// status ignored
}
+ uint32_t NextMessageSize() GRPC_OVERRIDE {return call_.max_message_size();}
+
bool Read(R* msg) GRPC_OVERRIDE {
CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> ops;
if (!context_->initial_metadata_received_) {
@@ -293,6 +298,8 @@ class ClientReaderWriter GRPC_FINAL : public ClientReaderWriterInterface<W, R> {
cq_.Pluck(&ops); // status ignored
}
+ uint32_t NextMessageSize() GRPC_OVERRIDE {return call_.max_message_size();}
+
bool Read(R* msg) GRPC_OVERRIDE {
CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> ops;
if (!context_->initial_metadata_received_) {
@@ -352,6 +359,8 @@ class ServerReader GRPC_FINAL : public ReaderInterface<R> {
call_->cq()->Pluck(&ops);
}
+ uint32_t NextMessageSize() GRPC_OVERRIDE {return call_->max_message_size();}
+
bool Read(R* msg) GRPC_OVERRIDE {
CallOpSet<CallOpRecvMessage<R>> ops;
ops.RecvMessage(msg);
@@ -418,6 +427,8 @@ class ServerReaderWriter GRPC_FINAL : public WriterInterface<W>,
call_->cq()->Pluck(&ops);
}
+ uint32_t NextMessageSize() GRPC_OVERRIDE {return call_->max_message_size();}
+
bool Read(R* msg) GRPC_OVERRIDE {
CallOpSet<CallOpRecvMessage<R>> ops;
ops.RecvMessage(msg);
diff --git a/include/grpc++/support/fc_unary.h b/include/grpc++/support/fc_unary.h
new file mode 100644
index 0000000000..7e7dea8feb
--- /dev/null
+++ b/include/grpc++/support/fc_unary.h
@@ -0,0 +1,39 @@
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPCXX_SUPPORT_FC_UNARY_H
+#define GRPCXX_SUPPORT_FC_UNARY_H
+
+#include <grpc++/impl/codegen/fc_unary.h>
+
+#endif // GRPCXX_SUPPORT_FC_UNARY_H
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
index c386115ec2..dcf995ff61 100644
--- a/src/compiler/cpp_generator.cc
+++ b/src/compiler/cpp_generator.cc
@@ -130,6 +130,7 @@ grpc::string GetHeaderIncludes(File *file, const Parameters &params) {
static const char *headers_strs[] = {
"grpc++/impl/codegen/async_stream.h",
"grpc++/impl/codegen/async_unary_call.h",
+ "grpc++/impl/codegen/fc_unary.h",
"grpc++/impl/codegen/proto_utils.h",
"grpc++/impl/codegen/rpc_method.h",
"grpc++/impl/codegen/service_type.h",
@@ -604,6 +605,54 @@ void PrintHeaderServerMethodAsync(Printer *printer, const Method *method,
printer->Print(*vars, "};\n");
}
+void PrintHeaderServerMethodFCUnary(
+ Printer *printer,
+ const Method *method,
+ std::map<grpc::string, grpc::string> *vars) {
+ (*vars)["Method"] = method->name();
+ (*vars)["Request"] = method->input_type_name();
+ (*vars)["Response"] = method->output_type_name();
+ if (method->NoStreaming()) {
+ printer->Print(*vars, "template <class BaseClass>\n");
+ printer->Print(*vars,
+ "class WithFCUnaryMethod_$Method$ : public BaseClass {\n");
+ printer->Print(
+ " private:\n"
+ " void BaseClassMustBeDerivedFromService(const Service *service) {}\n");
+ printer->Print(" public:\n");
+ printer->Indent();
+ printer->Print(*vars,
+ "WithFCUnaryMethod_$Method$() {\n"
+ " ::grpc::Service::MarkMethodFCUnary($Idx$,\n"
+ " new ::grpc::FCUnaryMethodHandler<Service, "
+ "$Request$, "
+ "$Response$>("
+ "std::bind(&WithFCUnaryMethod_$Method$<BaseClass>::FC$Method$, this, std::placeholders::_1, std::placeholders::_2)));\n"
+ "}\n");
+ printer->Print(*vars,
+ "~WithFCUnaryMethod_$Method$() GRPC_OVERRIDE {\n"
+ " BaseClassMustBeDerivedFromService(this);\n"
+ "}\n");
+ printer->Print(
+ *vars,
+ "// disable regular version of this method\n"
+ "::grpc::Status $Method$("
+ "::grpc::ServerContext* context, const $Request$* request, "
+ "$Response$* response) GRPC_FINAL GRPC_OVERRIDE {\n"
+ " abort();\n"
+ " return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"
+ "}\n");
+ printer->Print(
+ *vars,
+ "// replace default version of this method with FCUnary\n"
+ "virtual ::grpc::Status FC$Method$("
+ "::grpc::ServerContext* context, ::grpc::FCUnary< $Request$,$Response$>* fc_unary)"
+ " = 0;\n");
+ printer->Outdent();
+ printer->Print(*vars, "};\n");
+ }
+}
+
void PrintHeaderServerMethodGeneric(
Printer *printer, const Method *method,
std::map<grpc::string, grpc::string> *vars) {
@@ -770,6 +819,12 @@ void PrintHeaderService(Printer *printer, const Service *service,
PrintHeaderServerMethodGeneric(printer, service->method(i).get(), vars);
}
+ // Server side - FC Unary
+ for (int i = 0; i < service->method_count(); ++i) {
+ (*vars)["Idx"] = as_string(i);
+ PrintHeaderServerMethodFCUnary(printer, service->method(i).get(), vars);
+ }
+
printer->Outdent();
printer->Print("};\n");
printer->Print(service->GetTrailingComments().c_str());
@@ -870,6 +925,7 @@ grpc::string GetSourceIncludes(File *file, const Parameters &params) {
"grpc++/impl/codegen/async_unary_call.h",
"grpc++/impl/codegen/channel_interface.h",
"grpc++/impl/codegen/client_unary_call.h",
+ "grpc++/impl/codegen/fc_unary.h",
"grpc++/impl/codegen/method_handler_impl.h",
"grpc++/impl/codegen/rpc_service_method.h",
"grpc++/impl/codegen/service_type.h",
@@ -1080,6 +1136,9 @@ void PrintSourceService(Printer *printer, const Service *service,
(*vars)["Idx"] = as_string(i);
if (method->NoStreaming()) {
(*vars)["StreamingType"] = "NORMAL_RPC";
+ // NOTE: There is no reason to consider FC_UNARY as a separate
+ // category here since this part is setting up the client-side stub
+ // and this appears as a NORMAL_RPC from the client-side.
} else if (method->ClientOnlyStreaming()) {
(*vars)["StreamingType"] = "CLIENT_STREAMING";
} else if (method->ServerOnlyStreaming()) {
diff --git a/src/cpp/ext/reflection.grpc.pb.cc b/src/cpp/ext/reflection.grpc.pb.cc
index b046dfc1b8..f4a0b97d65 100644
--- a/src/cpp/ext/reflection.grpc.pb.cc
+++ b/src/cpp/ext/reflection.grpc.pb.cc
@@ -43,6 +43,7 @@
#include <grpc++/impl/codegen/async_unary_call.h>
#include <grpc++/impl/codegen/channel_interface.h>
#include <grpc++/impl/codegen/client_unary_call.h>
+#include <grpc++/impl/codegen/fc_unary.h>
#include <grpc++/impl/codegen/method_handler_impl.h>
#include <grpc++/impl/codegen/rpc_service_method.h>
#include <grpc++/impl/codegen/service_type.h>
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc
index af04fd4ca6..c1fbaa09f5 100644
--- a/src/cpp/server/server.cc
+++ b/src/cpp/server/server.cc
@@ -342,6 +342,7 @@ static grpc_server_register_method_payload_handling PayloadHandlingForMethod(
return GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER;
case RpcMethod::CLIENT_STREAMING:
case RpcMethod::BIDI_STREAMING:
+ case RpcMethod::FC_UNARY:
return GRPC_SRM_PAYLOAD_NONE;
}
GPR_UNREACHABLE_CODE(return GRPC_SRM_PAYLOAD_NONE;);
diff --git a/test/cpp/codegen/compiler_test_golden b/test/cpp/codegen/compiler_test_golden
index ef3d1aaa51..75b090a3f3 100644
--- a/test/cpp/codegen/compiler_test_golden
+++ b/test/cpp/codegen/compiler_test_golden
@@ -43,6 +43,8 @@
#include <grpc++/impl/codegen/async_stream.h>
#include <grpc++/impl/codegen/async_unary_call.h>
+#include <grpc++/impl/codegen/fc_unary.h>
+#include <grpc++/impl/codegen/method_handler_impl.h>
#include <grpc++/impl/codegen/proto_utils.h>
#include <grpc++/impl/codegen/rpc_method.h>
#include <grpc++/impl/codegen/service_type.h>
@@ -206,6 +208,26 @@ class ServiceA GRPC_FINAL {
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
};
+ template <class BaseClass>
+ class WithFCUnaryMethod_MethodA1 : public BaseClass {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service *service) {}
+ public:
+ WithFCUnaryMethod_MethodA1() {
+ ::grpc::Service::MarkMethodFCUnary(0,
+ new ::grpc::FCUnaryMethodHandler<Service, ::grpc::testing::Request, ::grpc::testing::Response>(std::bind(&WithFCUnaryMethod_MethodA1<BaseClass>::FCMethodA1, this, std::placeholders::_1, std::placeholders::_2)));
+ }
+ ~WithFCUnaryMethod_MethodA1() GRPC_OVERRIDE {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable regular version of this method
+ ::grpc::Status MethodA1(::grpc::ServerContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response) GRPC_FINAL GRPC_OVERRIDE {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ // replace default version of this method with FCUnary
+ virtual ::grpc::Status FCMethodA1(::grpc::ServerContext* context, ::grpc::FCUnary< ::grpc::testing::Request,::grpc::testing::Response>* fc_unary) = 0;
+ };
};
// ServiceB leading comment 1
@@ -284,6 +306,26 @@ class ServiceB GRPC_FINAL {
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
};
+ template <class BaseClass>
+ class WithFCUnaryMethod_MethodB1 : public BaseClass {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service *service) {}
+ public:
+ WithFCUnaryMethod_MethodB1() {
+ ::grpc::Service::MarkMethodFCUnary(0,
+ new ::grpc::FCUnaryMethodHandler<Service, ::grpc::testing::Request, ::grpc::testing::Response>(std::bind(&WithFCUnaryMethod_MethodB1<BaseClass>::FCMethodB1, this, std::placeholders::_1, std::placeholders::_2)));
+ }
+ ~WithFCUnaryMethod_MethodB1() GRPC_OVERRIDE {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable regular version of this method
+ ::grpc::Status MethodB1(::grpc::ServerContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response) GRPC_FINAL GRPC_OVERRIDE {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ // replace default version of this method with FCUnary
+ virtual ::grpc::Status FCMethodB1(::grpc::ServerContext* context, ::grpc::FCUnary< ::grpc::testing::Request,::grpc::testing::Response>* fc_unary) = 0;
+ };
};
// ServiceB trailing comment 1
diff --git a/test/cpp/end2end/hybrid_end2end_test.cc b/test/cpp/end2end/hybrid_end2end_test.cc
index 7e0c0e8a7c..699cf49b26 100644
--- a/test/cpp/end2end/hybrid_end2end_test.cc
+++ b/test/cpp/end2end/hybrid_end2end_test.cc
@@ -199,7 +199,7 @@ class HybridEnd2endTest : public ::testing::Test {
HybridEnd2endTest() {}
void SetUpServer(::grpc::Service* service1, ::grpc::Service* service2,
- AsyncGenericService* generic_service) {
+ AsyncGenericService* generic_service, int max_message_size = 0) {
int port = grpc_pick_unused_port_or_die();
server_address_ << "localhost:" << port;
@@ -217,6 +217,11 @@ class HybridEnd2endTest : public ::testing::Test {
if (generic_service) {
builder.RegisterAsyncGenericService(generic_service);
}
+
+ if (max_message_size != 0) {
+ builder.SetMaxMessageSize(max_message_size);
+ }
+
// Create a separate cq for each potential handler.
for (int i = 0; i < 5; i++) {
cqs_.push_back(builder.AddCompletionQueue(false));
@@ -415,6 +420,38 @@ TEST_F(HybridEnd2endTest, AsyncRequestStreamResponseStream_SyncDupService) {
request_stream_handler_thread.join();
}
+// Add a second service with one sync FCUnary method.
+class FCUnaryDupPkg : public duplicate::EchoTestService::WithFCUnaryMethod_Echo<TestServiceImplDupPkg> {
+public:
+ Status FCEcho(ServerContext* context, FCUnary<EchoRequest,EchoResponse>* fc_unary) GRPC_OVERRIDE {
+ EchoRequest req;
+ EchoResponse resp;
+ gpr_log(GPR_INFO, "FC Unary Next Message Size is %u", fc_unary->NextMessageSize());
+ GPR_ASSERT(fc_unary->Read(&req));
+ resp.set_message(req.message() + "_dup");
+ GPR_ASSERT(fc_unary->Write(resp));
+ return Status::OK;
+ }
+};
+
+TEST_F(HybridEnd2endTest, AsyncRequestStreamResponseStream_SyncFCUnaryDupService) {
+ typedef EchoTestService::WithAsyncMethod_RequestStream<
+ EchoTestService::WithAsyncMethod_ResponseStream<TestServiceImpl>>
+ SType;
+ SType service;
+ FCUnaryDupPkg dup_service;
+ SetUpServer(&service, &dup_service, nullptr, 8192);
+ ResetStub();
+ std::thread response_stream_handler_thread(HandleServerStreaming<SType>,
+ &service, cqs_[0].get());
+ std::thread request_stream_handler_thread(HandleClientStreaming<SType>,
+ &service, cqs_[1].get());
+ TestAllMethods();
+ SendEchoToDupService();
+ response_stream_handler_thread.join();
+ request_stream_handler_thread.join();
+}
+
// Add a second service with one async method.
TEST_F(HybridEnd2endTest, AsyncRequestStreamResponseStream_AsyncDupService) {
typedef EchoTestService::WithAsyncMethod_RequestStream<
diff --git a/test/cpp/end2end/mock_test.cc b/test/cpp/end2end/mock_test.cc
index 0ace5d9418..744a7cd9eb 100644
--- a/test/cpp/end2end/mock_test.cc
+++ b/test/cpp/end2end/mock_test.cc
@@ -31,6 +31,7 @@
*
*/
+#include <climits>
#include <thread>
#include <grpc++/channel.h>
@@ -63,6 +64,7 @@ class MockClientReaderWriter GRPC_FINAL
: public ClientReaderWriterInterface<W, R> {
public:
void WaitForInitialMetadata() GRPC_OVERRIDE {}
+ uint32_t NextMessageSize() GRPC_OVERRIDE {return UINT_MAX;}
bool Read(R* msg) GRPC_OVERRIDE { return true; }
bool Write(const W& msg) GRPC_OVERRIDE { return true; }
bool WritesDone() GRPC_OVERRIDE { return true; }
@@ -74,6 +76,7 @@ class MockClientReaderWriter<EchoRequest, EchoResponse> GRPC_FINAL
public:
MockClientReaderWriter() : writes_done_(false) {}
void WaitForInitialMetadata() GRPC_OVERRIDE {}
+ uint32_t NextMessageSize() GRPC_OVERRIDE {return UINT_MAX;}
bool Read(EchoResponse* msg) GRPC_OVERRIDE {
if (writes_done_) return false;
msg->set_message(last_message_);
diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++
index a2415e1217..d262241979 100644
--- a/tools/doxygen/Doxyfile.c++
+++ b/tools/doxygen/Doxyfile.c++
@@ -800,6 +800,7 @@ include/grpc++/support/async_unary_call.h \
include/grpc++/support/byte_buffer.h \
include/grpc++/support/channel_arguments.h \
include/grpc++/support/config.h \
+include/grpc++/support/fc_unary.h \
include/grpc++/support/slice.h \
include/grpc++/support/status.h \
include/grpc++/support/status_code_enum.h \
@@ -819,6 +820,7 @@ include/grpc++/impl/codegen/completion_queue_tag.h \
include/grpc++/impl/codegen/config.h \
include/grpc++/impl/codegen/core_codegen_interface.h \
include/grpc++/impl/codegen/create_auth_context.h \
+include/grpc++/impl/codegen/fc_unary.h \
include/grpc++/impl/codegen/grpc_library.h \
include/grpc++/impl/codegen/method_handler_impl.h \
include/grpc++/impl/codegen/rpc_method.h \
diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal
index 945298b964..764be900a4 100644
--- a/tools/doxygen/Doxyfile.c++.internal
+++ b/tools/doxygen/Doxyfile.c++.internal
@@ -800,6 +800,7 @@ include/grpc++/support/async_unary_call.h \
include/grpc++/support/byte_buffer.h \
include/grpc++/support/channel_arguments.h \
include/grpc++/support/config.h \
+include/grpc++/support/fc_unary.h \
include/grpc++/support/slice.h \
include/grpc++/support/status.h \
include/grpc++/support/status_code_enum.h \
@@ -819,6 +820,7 @@ include/grpc++/impl/codegen/completion_queue_tag.h \
include/grpc++/impl/codegen/config.h \
include/grpc++/impl/codegen/core_codegen_interface.h \
include/grpc++/impl/codegen/create_auth_context.h \
+include/grpc++/impl/codegen/fc_unary.h \
include/grpc++/impl/codegen/grpc_library.h \
include/grpc++/impl/codegen/method_handler_impl.h \
include/grpc++/impl/codegen/rpc_method.h \
diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json
index e3cfd55cd6..0cabb947dc 100644
--- a/tools/run_tests/sources_and_headers.json
+++ b/tools/run_tests/sources_and_headers.json
@@ -6543,6 +6543,7 @@
"include/grpc++/support/byte_buffer.h",
"include/grpc++/support/channel_arguments.h",
"include/grpc++/support/config.h",
+ "include/grpc++/support/fc_unary.h",
"include/grpc++/support/slice.h",
"include/grpc++/support/status.h",
"include/grpc++/support/status_code_enum.h",
@@ -6597,6 +6598,7 @@
"include/grpc++/support/byte_buffer.h",
"include/grpc++/support/channel_arguments.h",
"include/grpc++/support/config.h",
+ "include/grpc++/support/fc_unary.h",
"include/grpc++/support/slice.h",
"include/grpc++/support/status.h",
"include/grpc++/support/status_code_enum.h",
@@ -6654,6 +6656,7 @@
"include/grpc++/impl/codegen/config.h",
"include/grpc++/impl/codegen/core_codegen_interface.h",
"include/grpc++/impl/codegen/create_auth_context.h",
+ "include/grpc++/impl/codegen/fc_unary.h",
"include/grpc++/impl/codegen/grpc_library.h",
"include/grpc++/impl/codegen/method_handler_impl.h",
"include/grpc++/impl/codegen/rpc_method.h",
@@ -6688,6 +6691,7 @@
"include/grpc++/impl/codegen/config.h",
"include/grpc++/impl/codegen/core_codegen_interface.h",
"include/grpc++/impl/codegen/create_auth_context.h",
+ "include/grpc++/impl/codegen/fc_unary.h",
"include/grpc++/impl/codegen/grpc_library.h",
"include/grpc++/impl/codegen/method_handler_impl.h",
"include/grpc++/impl/codegen/rpc_method.h",
diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj b/vsprojects/vcxproj/grpc++/grpc++.vcxproj
index cb9e41ea22..730e6c0c6c 100644
--- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj
+++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj
@@ -298,6 +298,7 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\byte_buffer.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\channel_arguments.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\config.h" />
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\support\fc_unary.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\slice.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\status.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\status_code_enum.h" />
@@ -317,6 +318,7 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\core_codegen_interface.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h" />
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\fc_unary.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\method_handler_impl.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_method.h" />
diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters
index a9051182b3..c444cf0cb6 100644
--- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters
+++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters
@@ -222,6 +222,9 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\config.h">
<Filter>include\grpc++\support</Filter>
</ClInclude>
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\support\fc_unary.h">
+ <Filter>include\grpc++\support</Filter>
+ </ClInclude>
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\slice.h">
<Filter>include\grpc++\support</Filter>
</ClInclude>
@@ -279,6 +282,9 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h">
<Filter>include\grpc++\impl\codegen</Filter>
</ClInclude>
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\fc_unary.h">
+ <Filter>include\grpc++\impl\codegen</Filter>
+ </ClInclude>
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h">
<Filter>include\grpc++\impl\codegen</Filter>
</ClInclude>
diff --git a/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj b/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj
index 7c3e63b208..e7f504fc2b 100644
--- a/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj
+++ b/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj
@@ -163,6 +163,7 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\core_codegen_interface.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h" />
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\fc_unary.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\method_handler_impl.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_method.h" />
diff --git a/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj.filters b/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj.filters
index d9cd49cc30..edc8866420 100644
--- a/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj.filters
+++ b/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj.filters
@@ -63,6 +63,9 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h">
<Filter>include\grpc++\impl\codegen</Filter>
</ClInclude>
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\fc_unary.h">
+ <Filter>include\grpc++\impl\codegen</Filter>
+ </ClInclude>
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h">
<Filter>include\grpc++\impl\codegen</Filter>
</ClInclude>
diff --git a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj
index d0fca9ba65..026952c1bd 100644
--- a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj
+++ b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj
@@ -159,6 +159,7 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\core_codegen_interface.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h" />
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\fc_unary.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\method_handler_impl.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_method.h" />
diff --git a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters
index cc98c60408..cc3fb70fa4 100644
--- a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters
+++ b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters
@@ -69,6 +69,9 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h">
<Filter>include\grpc++\impl\codegen</Filter>
</ClInclude>
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\fc_unary.h">
+ <Filter>include\grpc++\impl\codegen</Filter>
+ </ClInclude>
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h">
<Filter>include\grpc++\impl\codegen</Filter>
</ClInclude>
diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj
index 03be485b29..0b97b1ebc3 100644
--- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj
+++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj
@@ -298,6 +298,7 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\byte_buffer.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\channel_arguments.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\config.h" />
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\support\fc_unary.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\slice.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\status.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\status_code_enum.h" />
@@ -317,6 +318,7 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\core_codegen_interface.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h" />
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\fc_unary.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\method_handler_impl.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_method.h" />
diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters
index ba99bc53c8..85cc8f7814 100644
--- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters
+++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters
@@ -207,6 +207,9 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\config.h">
<Filter>include\grpc++\support</Filter>
</ClInclude>
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\support\fc_unary.h">
+ <Filter>include\grpc++\support</Filter>
+ </ClInclude>
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\slice.h">
<Filter>include\grpc++\support</Filter>
</ClInclude>
@@ -264,6 +267,9 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h">
<Filter>include\grpc++\impl\codegen</Filter>
</ClInclude>
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\fc_unary.h">
+ <Filter>include\grpc++\impl\codegen</Filter>
+ </ClInclude>
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h">
<Filter>include\grpc++\impl\codegen</Filter>
</ClInclude>
diff --git a/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj b/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj
index e608f7ed3a..0e2b0d8adb 100644
--- a/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj
+++ b/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj
@@ -172,6 +172,7 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\core_codegen_interface.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h" />
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\fc_unary.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\method_handler_impl.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_method.h" />
diff --git a/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj.filters b/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj.filters
index 8fc8f3901b..098c89cdcc 100644
--- a/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj.filters
+++ b/vsprojects/vcxproj/test/codegen_test_full/codegen_test_full.vcxproj.filters
@@ -57,6 +57,9 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h">
<Filter>include\grpc++\impl\codegen</Filter>
</ClInclude>
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\fc_unary.h">
+ <Filter>include\grpc++\impl\codegen</Filter>
+ </ClInclude>
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h">
<Filter>include\grpc++\impl\codegen</Filter>
</ClInclude>
diff --git a/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj b/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj
index 3331c61847..d5133f7238 100644
--- a/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj
+++ b/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj
@@ -172,6 +172,7 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\core_codegen_interface.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h" />
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\fc_unary.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\method_handler_impl.h" />
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_method.h" />
diff --git a/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj.filters b/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj.filters
index a8ff115317..e4e68de185 100644
--- a/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj.filters
+++ b/vsprojects/vcxproj/test/codegen_test_minimal/codegen_test_minimal.vcxproj.filters
@@ -60,6 +60,9 @@
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h">
<Filter>include\grpc++\impl\codegen</Filter>
</ClInclude>
+ <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\fc_unary.h">
+ <Filter>include\grpc++\impl\codegen</Filter>
+ </ClInclude>
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h">
<Filter>include\grpc++\impl\codegen</Filter>
</ClInclude>