diff options
author | 2015-02-12 16:09:08 -0800 | |
---|---|---|
committer | 2015-02-12 16:09:08 -0800 | |
commit | cbcc977857bb81e624b5cbca3c05eb68d9797826 (patch) | |
tree | 706bd28a6ff8c7cd11703236993bf09b5f2a54b6 /include/grpc++ | |
parent | 3d20c5e8c68308b25c1cc248c613e08e1c7d7b32 (diff) |
fix sync unary call with metadata pieces
Diffstat (limited to 'include/grpc++')
-rw-r--r-- | include/grpc++/client_context.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h index f74de8fad4..5ff60a5399 100644 --- a/include/grpc++/client_context.h +++ b/include/grpc++/client_context.h @@ -47,9 +47,18 @@ using std::chrono::system_clock; struct grpc_call; struct grpc_completion_queue; +namespace google { +namespace protobuf { +class Message; +} // namespace protobuf +} // namespace google + namespace grpc { class CallOpBuffer; +class ChannelInterface; +class RpcMethod; +class Status; template <class R> class ClientReader; template <class W> class ClientWriter; template <class R, class W> class ClientReaderWriter; @@ -65,6 +74,16 @@ class ClientContext { void AddMetadata(const grpc::string &meta_key, const grpc::string &meta_value); + std::multimap<grpc::string, grpc::string> GetServerInitialMetadata() { + GPR_ASSERT(initial_metadata_received_); + return recv_initial_metadata_; + } + + std::multimap<grpc::string, grpc::string> GetServerTrailingMetadata() { + // TODO(yangg) check finished + return trailing_metadata_; + } + void set_absolute_deadline(const system_clock::time_point &deadline); system_clock::time_point absolute_deadline(); @@ -83,6 +102,10 @@ class ClientContext { template <class R> friend class ::grpc::ClientAsyncReader; template <class W> friend class ::grpc::ClientAsyncWriter; template <class R, class W> friend class ::grpc::ClientAsyncReaderWriter; + friend Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, + ClientContext *context, + const google::protobuf::Message &request, + google::protobuf::Message *result); grpc_call *call() { return call_; } void set_call(grpc_call *call) { |