GRPC C++  1.81.0
server_context.h
Go to the documentation of this file.
1 //
2 //
3 // Copyright 2015 gRPC authors.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 //
18 
19 #ifndef GRPCPP_SERVER_CONTEXT_H
20 #define GRPCPP_SERVER_CONTEXT_H
21 
22 #include <grpc/grpc.h>
23 #include <grpc/impl/call.h>
26 #include <grpcpp/impl/call.h>
35 #include <grpcpp/support/config.h>
39 #include <grpcpp/support/status.h>
41 #include <grpcpp/support/time.h>
42 
43 #include <atomic>
44 #include <cassert>
45 #include <map>
46 #include <memory>
47 #include <type_traits>
48 #include <vector>
49 
50 struct grpc_metadata;
51 struct grpc_call;
52 struct census_context;
53 
54 namespace grpc {
55 template <class W, class R>
57 template <class W>
59 template <class W>
61 template <class W, class R>
63 template <class R>
64 class ServerReader;
65 template <class W>
66 class ServerWriter;
67 
68 namespace internal {
69 template <class ServiceType, class RequestType, class ResponseType>
71 template <class RequestType, class ResponseType>
73 template <class RequestType, class ResponseType>
75 template <class RequestType, class ResponseType>
77 template <class RequestType, class ResponseType>
79 template <class ServiceType, class RequestType, class ResponseType>
81 template <class ResponseType>
83  ResponseType*, Status&);
84 template <class ServiceType, class RequestType, class ResponseType,
85  class BaseRequestType, class BaseResponseType>
86 class RpcMethodHandler;
87 template <class Base>
89 template <class W, class R>
91 template <class ServiceType, class RequestType, class ResponseType>
93 class ServerReactor;
94 template <class Streamer, bool WriteNeeded>
96 template <grpc::StatusCode code>
97 class ErrorMethodHandler;
98 } // namespace internal
99 
100 class ClientContext;
101 class CompletionQueue;
103 class Server;
104 class ServerInterface;
105 class ContextAllocator;
107 
108 namespace internal {
109 class Call;
110 } // namespace internal
111 
112 namespace testing {
113 class InteropServerContextInspector;
114 class ServerContextTestSpouse;
115 class DefaultReactorTestPeer;
116 } // namespace testing
117 
118 namespace experimental {
119 class CallMetricRecorder;
120 class ServerMetricRecorder;
121 namespace internal {
122 template <class RequestType>
123 class CallbackSessionHandler;
124 } // namespace internal
125 } // namespace experimental
126 
129  public:
130  virtual ~ServerContextBase();
131 
133  std::chrono::system_clock::time_point deadline() const {
134  return grpc::Timespec2Timepoint(deadline_);
135  }
136 
138  gpr_timespec raw_deadline() const { return deadline_; }
139 
163  void AddInitialMetadata(const std::string& key, const std::string& value);
164 
188  void AddTrailingMetadata(const std::string& key, const std::string& value);
189 
201  bool IsCancelled() const;
202 
223  void TryCancel() const;
224 
234  const std::multimap<grpc::string_ref, grpc::string_ref>& client_metadata()
235  const {
236  return *client_metadata_.map();
237  }
238 
241  return compression_level_;
242  }
243 
248  compression_level_set_ = true;
249  compression_level_ = level;
250  }
251 
255  bool compression_level_set() const { return compression_level_set_; }
256 
262  return compression_algorithm_;
263  }
268 
270  void SetLoadReportingCosts(const std::vector<std::string>& cost_data);
271 
275  std::shared_ptr<const grpc::AuthContext> auth_context() const {
276  if (auth_context_ == nullptr) {
277  auth_context_ = grpc::CreateAuthContext(call_.call);
278  }
279  return auth_context_;
280  }
281 
286  std::string peer() const;
287 
289  const struct census_context* census_context() const;
290 
293  grpc_call* c_call() { return call_.call; }
294 
301  return call_metric_recorder_;
302  }
303 
305  return memory_allocator_;
306  }
307 
311 
312  protected:
318  void AsyncNotifyWhenDone(void* tag) {
319  has_notify_when_done_tag_ = true;
320  async_notify_when_done_tag_ = tag;
321  }
322 
326  RpcAllocatorState* GetRpcAllocatorState() { return message_allocator_state_; }
327 
343  // Short-circuit the case where a default reactor was already set up by
344  // the TestPeer.
345  if (test_unary_ != nullptr) {
346  return reinterpret_cast<Reactor*>(&default_reactor_);
347  }
348  new (&default_reactor_) Reactor;
349 #ifndef NDEBUG
350  bool old = false;
351  assert(default_reactor_used_.compare_exchange_strong(
352  old, true, std::memory_order_relaxed));
353 #else
354  default_reactor_used_.store(true, std::memory_order_relaxed);
355 #endif
356  return reinterpret_cast<Reactor*>(&default_reactor_);
357  }
358 
362 
364  context_allocator_ = context_allocator;
365  }
366 
367  ContextAllocator* context_allocator() const { return context_allocator_; }
368 
369  private:
373  friend class grpc::ServerInterface;
374  friend class grpc::Server;
375  template <class W, class R>
377  template <class W>
379  template <class W>
381  template <class W, class R>
383  template <class R>
384  friend class grpc::ServerReader;
385  template <class W>
386  friend class grpc::ServerWriter;
387  template <class W, class R>
389  template <class ResponseType>
391  const internal::MethodHandler::HandlerParameter& param, ResponseType* rsp,
392  Status& status);
393  template <class ServiceType, class RequestType, class ResponseType,
394  class BaseRequestType, class BaseResponseType>
396  template <class ServiceType, class RequestType, class ResponseType>
398  template <class ServiceType, class RequestType, class ResponseType>
400  template <class Streamer, bool WriteNeeded>
402  template <class RequestType, class ResponseType>
404  template <class RequestType, class ResponseType>
406  template <class RequestType, class ResponseType>
408  template <class RequestType, class ResponseType>
410  template <class RequestType>
412  template <grpc::StatusCode code>
414  template <class Base>
416  friend class grpc::ClientContext;
419 
422  ServerContextBase& operator=(const ServerContextBase&);
423 
424  class CompletionOp;
425 
426  void BeginCompletionOp(
427  grpc::internal::Call* call, std::function<void(bool)> callback,
428  grpc::internal::ServerCallbackCall* callback_controller);
430  grpc::internal::CompletionQueueTag* GetCompletionOpTag();
431 
432  void set_call(
433  grpc_call* call, bool call_metric_recording_enabled,
434  experimental::ServerMetricRecorder* server_metric_recorder,
436  call_.call = call;
437  if (call_metric_recording_enabled) {
438  CreateCallMetricRecorder(server_metric_recorder);
439  }
440  memory_allocator_ = memory_allocator;
441  }
442 
443  void BindDeadlineAndMetadata(gpr_timespec deadline, grpc_metadata_array* arr);
444 
445  uint32_t initial_metadata_flags() const { return 0; }
446 
447  grpc::experimental::ServerRpcInfo* set_server_rpc_info(
448  const char* method, grpc::internal::RpcMethod::RpcType type,
449  const std::vector<std::unique_ptr<
451  if (!creators.empty()) {
452  rpc_info_ = new grpc::experimental::ServerRpcInfo(this, method, type);
453  rpc_info_->RegisterInterceptors(creators);
454  }
455  return rpc_info_;
456  }
457 
458  void set_message_allocator_state(RpcAllocatorState* allocator_state) {
459  message_allocator_state_ = allocator_state;
460  }
461 
462  void MaybeMarkCancelledOnRead() {
463  if (grpc_call_failed_before_recv_message(call_.call)) {
464  marked_cancelled_.store(true, std::memory_order_release);
465  }
466  }
467 
468  // This should be called only once and only when call metric recording is
469  // enabled.
470  void CreateCallMetricRecorder(
471  experimental::ServerMetricRecorder* server_metric_recorder = nullptr);
472 
473  struct CallWrapper {
474  ~CallWrapper();
475 
476  grpc_call* call = nullptr;
477  };
478 
479  // NOTE: call_ must be the first data member of this object so that its
480  // destructor is the last to be called, since its destructor may unref
481  // the underlying core call which holds the arena that may be used to
482  // hold this object.
483  CallWrapper call_;
484 
485  CompletionOp* completion_op_ = nullptr;
486  bool has_notify_when_done_tag_ = false;
487  void* async_notify_when_done_tag_ = nullptr;
489 
490  gpr_timespec deadline_;
491  grpc::CompletionQueue* cq_ = nullptr;
492  bool sent_initial_metadata_ = false;
493  mutable std::shared_ptr<const grpc::AuthContext> auth_context_;
494  mutable grpc::internal::MetadataMap client_metadata_;
495  std::multimap<std::string, std::string> initial_metadata_;
496  std::multimap<std::string, std::string> trailing_metadata_;
497 
498  bool compression_level_set_ = false;
499  grpc_compression_level compression_level_;
500  grpc_compression_algorithm compression_algorithm_;
501 
504  pending_ops_;
505  bool has_pending_ops_ = false;
506 
507  grpc::experimental::ServerRpcInfo* rpc_info_ = nullptr;
508  RpcAllocatorState* message_allocator_state_ = nullptr;
509  ContextAllocator* context_allocator_ = nullptr;
510  experimental::CallMetricRecorder* call_metric_recorder_ = nullptr;
511  grpc_event_engine::experimental::MemoryAllocator* memory_allocator_ = nullptr;
512 
513  class Reactor : public grpc::ServerUnaryReactor {
514  public:
515  void OnCancel() override {}
516  void OnDone() override {}
517  // Override InternalInlineable for this class since its reactions are
518  // trivial and thus do not need to be run from the EventEngine (potentially
519  // triggering a thread hop). This should only be used by internal reactors
520  // (thus the name) and not by user application code.
521  bool InternalInlineable() override { return true; }
522  };
523 
524  void SetupTestDefaultReactor(std::function<void(grpc::Status)> func) {
525  // NOLINTNEXTLINE(modernize-make-unique)
526  test_unary_.reset(new TestServerCallbackUnary(this, std::move(func)));
527  }
528  bool test_status_set() const {
529  return (test_unary_ != nullptr) && test_unary_->status_set();
530  }
531  grpc::Status test_status() const { return test_unary_->status(); }
532 
533  class TestServerCallbackUnary : public grpc::ServerCallbackUnary {
534  public:
535  TestServerCallbackUnary(ServerContextBase* ctx,
536  std::function<void(grpc::Status)> func)
537  : reactor_(ctx->DefaultReactor()),
538  func_(std::move(func)),
539  call_(ctx->c_call()) {
540  this->BindReactor(reactor_);
541  }
542  void Finish(grpc::Status s) override {
543  status_ = s;
544  func_(std::move(s));
545  status_set_.store(true, std::memory_order_release);
546  }
547  void SendInitialMetadata() override {}
548 
549  bool status_set() const {
550  return status_set_.load(std::memory_order_acquire);
551  }
552  grpc::Status status() const { return status_; }
553 
554  private:
555  void CallOnDone() override {}
556 
557  grpc_call* call() override { return call_; }
558 
559  grpc::internal::ServerReactor* reactor() override { return reactor_; }
560 
561  grpc::ServerUnaryReactor* const reactor_;
562  std::atomic_bool status_set_{false};
563  grpc::Status status_;
564  const std::function<void(grpc::Status s)> func_;
565  grpc_call* call_;
566  };
567 
568  alignas(Reactor) char default_reactor_[sizeof(Reactor)];
569  std::atomic_bool default_reactor_used_{false};
570 
571  std::atomic_bool marked_cancelled_{false};
572 
573  std::unique_ptr<TestServerCallbackUnary> test_unary_;
574 };
575 
593  public:
594  ServerContext() {} // for async calls
595 
613 
614  // Sync/CQ-based Async ServerContext only
616 
617  private:
618  // Constructor for internal use by server only
619  friend class grpc::Server;
621  : ServerContextBase(deadline, arr) {}
622 
623  // CallbackServerContext only
626 
628  ServerContext(const ServerContext&) = delete;
629  ServerContext& operator=(const ServerContext&) = delete;
630 };
631 
633  public:
637 
657 
658  // CallbackServerContext only
661 
662  private:
663  // Sync/CQ-based Async ServerContext only
665 
668  CallbackServerContext& operator=(const CallbackServerContext&) = delete;
669 };
670 
677  public:
678  virtual ~ContextAllocator() {}
679 
680  virtual CallbackServerContext* NewCallbackServerContext() { return nullptr; }
681 
683  return nullptr;
684  }
685 
686  virtual void Release(CallbackServerContext*) {}
687 
689 };
690 
691 } // namespace grpc
692 
693 static_assert(
694  std::is_base_of<grpc::ServerContextBase, grpc::ServerContext>::value,
695  "improper base class");
696 static_assert(std::is_base_of<grpc::ServerContextBase,
698  "improper base class");
699 static_assert(sizeof(grpc::ServerContextBase) == sizeof(grpc::ServerContext),
700  "wrong size");
701 static_assert(sizeof(grpc::ServerContextBase) ==
703  "wrong size");
704 
705 #endif // GRPCPP_SERVER_CONTEXT_H
grpc::internal::CallbackWithSuccessTag
CallbackWithSuccessTag can be reused multiple times, and will be used in this fashion for streaming o...
Definition: callback_common.h:153
grpc::string_ref
This class is a non owning reference to a string.
Definition: string_ref.h:40
census_context
struct census_context census_context
A Census Context is a handle used by Census to represent the current tracing and stats collection inf...
Definition: census.h:33
grpc::ServerContextBase::set_compression_algorithm
void set_compression_algorithm(grpc_compression_algorithm algorithm)
Set algorithm to be the compression algorithm used for the server call.
time.h
grpc::ServerContextBase::SetLoadReportingCosts
void SetLoadReportingCosts(const std::vector< std::string > &cost_data)
Set the serialized load reporting costs in cost_data for the call.
message_allocator.h
grpc::experimental::ServerMetricRecorder
Records server wide metrics to be reported to the client.
Definition: server_metric_recorder.h:42
grpc::ContextAllocator::NewGenericCallbackServerContext
virtual GenericCallbackServerContext * NewGenericCallbackServerContext()
Definition: server_context.h:682
grpc::ServerContext
A ServerContext or CallbackServerContext allows the code implementing a service handler to:
Definition: server_context.h:592
grpc::Server
Represents a gRPC server.
Definition: server.h:58
grpc::ServerContextBase::census_context
const struct census_context * census_context() const
Get the census context associated with this server call.
grpc
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm.h:33
grpc::internal::CallOpSet
Primary implementation of CallOpSetInterface.
Definition: completion_queue.h:97
grpc::ServerContextBase::IsCancelled
bool IsCancelled() const
Return whether this RPC failed before the server could provide its status back to the client.
grpc::CallbackServerContext
Definition: server_context.h:632
grpc::ServerContextBase::set_context_allocator
void set_context_allocator(ContextAllocator *context_allocator)
Definition: server_context.h:363
grpc::internal::CallOpSendMessage
Definition: call_op_set.h:287
grpc::RpcAllocatorState
Definition: message_allocator.h:26
grpc_call_failed_before_recv_message
GRPCAPI int grpc_call_failed_before_recv_message(const grpc_call *c)
grpc::ServerAsyncWriter
Async server-side API for doing server streaming RPCs, where the outgoing message stream from the ser...
Definition: server_context.h:58
grpc::internal::ErrorMethodHandler
General method handler class for errors that prevent real method use e.g., handle unknown method by r...
Definition: completion_queue.h:81
grpc::internal::MethodHandler::HandlerParameter
Definition: rpc_service_method.h:43
grpc_metadata_array
Definition: grpc_types.h:251
grpc::internal::RpcMethodHandler
A wrapper class of an application provided rpc method handler.
Definition: completion_queue.h:73
grpc::ServerWriter
Synchronous (blocking) server-side API for doing for doing a server-streaming RPCs,...
Definition: completion_queue.h:62
grpc_compression_algorithm
grpc_compression_algorithm
The various compression algorithms supported by gRPC (not sorted by compression level)
Definition: compression_types.h:61
grpc::ServerContextBase::DefaultReactor
grpc::ServerUnaryReactor * DefaultReactor()
Get a library-owned default unary reactor for use in minimal reaction cases.
Definition: server_context.h:342
grpc::internal::Call
Straightforward wrapping of the C call object.
Definition: call.h:34
grpc::ServerContextBase
Base class of ServerContext.
Definition: server_context.h:128
rpc_service_method.h
grpc::ServerContextBase::memory_allocator
grpc_event_engine::experimental::MemoryAllocator * memory_allocator()
Definition: server_context.h:304
grpc::ServerContextBase::context_allocator
ContextAllocator * context_allocator() const
Definition: server_context.h:367
status.h
grpc::ServerCallbackUnary::BindReactor
void BindReactor(Reactor *reactor)
Definition: server_callback.h:223
grpc::internal::CallOpSendInitialMetadata
Definition: call_op_set.h:217
grpc::ServerContextBase::ServerContextBase
ServerContextBase()
Constructors for use by derived classes.
completion_queue_tag.h
grpc::internal::MetadataMap
Definition: metadata_map.h:33
metadata_map.h
grpc::internal::ServerReaderWriterBody
Definition: completion_queue.h:65
grpc::ServerContextBase::DefaultReactorTestPeer
friend class grpc::testing::DefaultReactorTestPeer
Definition: server_context.h:372
grpc::ServerContextBase::ServerContextTestSpouse
friend class grpc::testing::ServerContextTestSpouse
Definition: server_context.h:371
grpc::internal::MetadataMap::map
std::multimap< grpc::string_ref, grpc::string_ref > * map()
Definition: metadata_map.h:66
grpc::Status
Did it work? If it didn't, why?
Definition: status.h:34
grpc_metadata
A single metadata element.
Definition: grpc_types.h:209
grpc::ContextAllocator::Release
virtual void Release(CallbackServerContext *)
Definition: server_context.h:686
grpc::experimental::CallMetricRecorder
Records call metrics for the purpose of load balancing.
Definition: call_metric_recorder.h:36
grpc::ServerContextBase::ExperimentalGetCallMetricRecorder
experimental::CallMetricRecorder * ExperimentalGetCallMetricRecorder()
Get the CallMetricRecorder object for the current RPC.
Definition: server_context.h:300
grpc::internal::ServerCallbackCall
The base class of ServerCallbackUnary etc.
Definition: server_callback.h:84
grpc::CreateAuthContext
std::shared_ptr< const AuthContext > CreateAuthContext(grpc_call *call)
TODO(ctiller): not sure we want to make this a permanent thing.
grpc::ServerReader
Synchronous (blocking) server-side API for doing client-streaming RPCs, where the incoming message st...
Definition: completion_queue.h:60
grpc::ServerContextBase::deadline
std::chrono::system_clock::time_point deadline() const
Return the deadline for the server call.
Definition: server_context.h:133
grpc::ServerContextBase::raw_deadline
gpr_timespec raw_deadline() const
Return a gpr_timespec representation of the server call's deadline.
Definition: server_context.h:138
callback_common.h
grpc::ClientContext
A ClientContext allows the person implementing a service client to:
Definition: client_context.h:203
grpc::ServerContextBase::GetRpcAllocatorState
RpcAllocatorState * GetRpcAllocatorState()
NOTE: This is an API for advanced users who need custom allocators.
Definition: server_context.h:326
grpc::ServerContextBase::AddInitialMetadata
void AddInitialMetadata(const std::string &key, const std::string &value)
Add the (key, value) pair to the initial metadata associated with a server call.
grpc.h
grpc_call
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:68
grpc::internal::CallbackUnaryHandler
Definition: server_callback_handlers.h:37
grpc::ServerContextBase::auth_context
std::shared_ptr< const grpc::AuthContext > auth_context() const
Return the authentication context for this server call.
Definition: server_context.h:275
grpc::internal::CallbackServerStreamingHandler
Definition: server_callback_handlers.h:451
grpc::ServerContextBase::compression_level_set
bool compression_level_set() const
Return a bool indicating whether the compression level for this call has been set (either implicitly ...
Definition: server_context.h:255
grpc::ContextAllocator::NewCallbackServerContext
virtual CallbackServerContext * NewCallbackServerContext()
Definition: server_context.h:680
grpc::internal::RpcMethod::RpcType
RpcType
Definition: rpc_method.h:31
grpc::CallbackServerContext::CallbackServerContext
CallbackServerContext()
Public constructors are for direct use only by mocking tests.
Definition: server_context.h:636
grpc::GenericServerContext
Definition: async_generic_service.h:37
grpc::ServerContextBase::AddTrailingMetadata
void AddTrailingMetadata(const std::string &key, const std::string &value)
Add the (key, value) pair to the initial metadata associated with a server call.
grpc::experimental::ServerRpcInfo
ServerRpcInfo represents the state of a particular RPC as it appears to an interceptor.
Definition: server_interceptor.h:58
grpc::internal::FinishOnlyReactor
Definition: server_context.h:88
server_interceptor.h
grpc::internal::CompletionQueueTag
An interface allowing implementors to process and filter event tags.
Definition: completion_queue_tag.h:26
compression_types.h
grpc::ServerContextBase::client_metadata
const std::multimap< grpc::string_ref, grpc::string_ref > & client_metadata() const
Return a collection of initial metadata key-value pairs sent from the client.
Definition: server_context.h:234
server_callback.h
grpc::experimental::internal::CallbackSessionHandler
Definition: server_callback_handlers.h:911
grpc::experimental::ServerInterceptorFactoryInterface
Definition: server_interceptor.h:45
grpc::ServerContextBase::~ServerContextBase
virtual ~ServerContextBase()
grpc::internal::ServerStreamingHandler
A wrapper class of an application provided server streaming handler.
Definition: completion_queue.h:77
grpc::ServerAsyncResponseWriter
Async server-side API for handling unary calls, where the single response message sent to the client ...
Definition: server_context.h:60
grpc::internal::CallbackBidiHandler
Definition: server_callback_handlers.h:682
grpc::ContextAllocator
A CallbackServerContext allows users to use the contents of the CallbackServerContext or GenericCallb...
Definition: server_context.h:676
grpc::internal::ClientStreamingHandler
A wrapper class of an application provided client streaming handler.
Definition: completion_queue.h:75
grpc::ServerContextBase::AsyncNotifyWhenDone
void AsyncNotifyWhenDone(void *tag)
Async only.
Definition: server_context.h:318
grpc::internal::TemplatedBidiStreamingHandler
A wrapper class of an application provided bidi-streaming handler.
Definition: completion_queue.h:79
config.h
call.h
grpc::internal::BidiStreamingHandler
Definition: server_context.h:70
grpc_compression_level
grpc_compression_level
Compression levels allow a party with knowledge of its peer's accepted encodings to request compressi...
Definition: compression_types.h:73
call_op_set.h
std
Definition: async_unary_call.h:410
call.h
grpc::ServerContextBase::InteropServerContextInspector
friend class grpc::testing::InteropServerContextInspector
Definition: server_context.h:370
grpc::GenericCallbackServerContext
Definition: callback_generic_service.h:36
create_auth_context.h
grpc::ServerContextBase::peer
std::string peer() const
Return the peer uri in a string.
grpc::internal::ServerReactor
Definition: server_callback.h:60
grpc::CompletionQueue
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue....
Definition: completion_queue.h:104
grpc::ServerContextBase::ExperimentalGetAuthority
grpc::string_ref ExperimentalGetAuthority() const
EXPERIMENTAL API Returns the call's authority.
grpc::internal::CallbackClientStreamingHandler
Definition: server_callback_handlers.h:257
grpc_event_engine::experimental::MemoryAllocator
Definition: memory_allocator.h:33
grpc::ServerContextBase::TryCancel
void TryCancel() const
Cancel the Call from the server.
grpc::ContextAllocator::~ContextAllocator
virtual ~ContextAllocator()
Definition: server_context.h:678
grpc::ServerAsyncReader
Async server-side API for doing client-streaming RPCs, where the incoming message stream from the cli...
Definition: server_context.h:56
grpc::ServerAsyncReaderWriter
Async server-side API for doing bidirectional streaming RPCs, where the incoming message stream comin...
Definition: server_context.h:62
grpc::ServerInterface
Definition: server_interface.h:59
grpc::ServerContext::ServerContext
ServerContext()
Definition: server_context.h:594
gpr_timespec
Analogous to struct timespec.
Definition: time.h:47
grpc::internal::UnaryRunHandlerHelper
void UnaryRunHandlerHelper(const grpc::internal::MethodHandler::HandlerParameter &, ResponseType *, grpc::Status &)
A helper function with reduced templating to do the common work needed to actually send the server re...
Definition: method_handler.h:59
grpc::ServerCallbackUnary
Definition: server_callback.h:213
grpc::ServerUnaryReactor
Definition: server_callback.h:736
auth_context.h
grpc::ServerContextBase::compression_algorithm
grpc_compression_algorithm compression_algorithm() const
Return the compression algorithm the server call will request be used.
Definition: server_context.h:261
grpc::ServerContextBase::c_call
grpc_call * c_call()
Should be used for framework-level extensions only.
Definition: server_context.h:293
grpc::Timespec2Timepoint
std::chrono::system_clock::time_point Timespec2Timepoint(gpr_timespec t)
grpc::ContextAllocator::Release
virtual void Release(GenericCallbackServerContext *)
Definition: server_context.h:688
string_ref.h
grpc::ServerContextBase::set_compression_level
void set_compression_level(grpc_compression_level level)
Set level to be the compression level used for the server call.
Definition: server_context.h:247
metadata_map.h
port_platform.h
grpc::ServerContextBase::compression_level
grpc_compression_level compression_level() const
Return the compression algorithm to be used by the server call.
Definition: server_context.h:240