diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc++/server_context.h | 10 | ||||
-rw-r--r-- | include/grpc/grpc.h | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h index cf2732b33d..23273f43e6 100644 --- a/include/grpc++/server_context.h +++ b/include/grpc++/server_context.h @@ -125,6 +125,14 @@ class ServerContext { const struct census_context* census_context() const; + // Async only. Has to be called before the rpc starts. + // Returns the tag in completion queue when the rpc finishes. + // IsCancelled() can then be called to check whether the rpc was cancelled. + void AsyncNotifyWhenDone(void* tag) { + has_notify_when_done_tag_ = true; + async_notify_when_done_tag_ = tag; + } + private: friend class ::grpc::testing::InteropContextInspector; friend class ::grpc::Server; @@ -165,6 +173,8 @@ class ServerContext { void set_call(grpc_call* call); CompletionOp* completion_op_; + bool has_notify_when_done_tag_; + void* async_notify_when_done_tag_; gpr_timespec deadline_; grpc_call* call_; diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index b928f123b5..407f36ad82 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -589,7 +589,7 @@ void grpc_server_register_completion_queue(grpc_server *server, /** Add a HTTP2 over plaintext over tcp listener. Returns bound port number on success, 0 on failure. REQUIRES: server not started */ -int grpc_server_add_http2_port(grpc_server *server, const char *addr); +int grpc_server_add_insecure_http2_port(grpc_server *server, const char *addr); /** Start a server - tells all listeners to start listening */ void grpc_server_start(grpc_server *server); |