|
| class | ::grpc::testing::InteropServerContextInspector |
| |
| class | ::grpc::testing::ServerContextTestSpouse |
| |
| class | ::grpc::ServerInterface |
| |
| class | ::grpc_impl::Server |
| |
| template<class W , class R > |
| class | ::grpc_impl::ServerAsyncReader |
| |
| template<class W > |
| class | ::grpc_impl::ServerAsyncWriter |
| |
| template<class W > |
| class | ::grpc_impl::ServerAsyncResponseWriter |
| |
| template<class W , class R > |
| class | ::grpc_impl::ServerAsyncReaderWriter |
| |
| template<class R > |
| class | ::grpc_impl::ServerReader |
| |
| template<class W > |
| class | ::grpc_impl::ServerWriter |
| |
| template<class W , class R > |
| class | ::grpc_impl::internal::ServerReaderWriterBody |
| |
| template<class ServiceType , class RequestType , class ResponseType > |
| class | ::grpc::internal::RpcMethodHandler |
| |
| template<class ServiceType , class RequestType , class ResponseType > |
| class | ::grpc::internal::ClientStreamingHandler |
| |
| template<class ServiceType , class RequestType , class ResponseType > |
| class | ::grpc::internal::ServerStreamingHandler |
| |
| template<class Streamer , bool WriteNeeded> |
| class | ::grpc::internal::TemplatedBidiStreamingHandler |
| |
| template<class RequestType , class ResponseType > |
| class | ::grpc_impl::internal::CallbackUnaryHandler |
| |
| template<class RequestType , class ResponseType > |
| class | ::grpc_impl::internal::CallbackClientStreamingHandler |
| |
| template<class RequestType , class ResponseType > |
| class | ::grpc_impl::internal::CallbackServerStreamingHandler |
| |
| template<class RequestType , class ResponseType > |
| class | ::grpc_impl::internal::CallbackBidiHandler |
| |
| template<::grpc::StatusCode code> |
| class | ::grpc::internal::ErrorMethodHandler |
| |
| class | ::grpc_impl::ClientContext |
| |
| class | ::grpc::GenericServerContext |
| |
A ServerContext allows the person implementing a service handler to:
- Add custom initial and trailing metadata key-value pairs that will propagated to the client side.
- Control call settings such as compression and authentication.
- Access metadata coming from the client.
- Get performance metrics (ie, census).
Context settings are only relevant to the call handler they are supplied to, that is to say, they aren't sticky across multiple calls. Some of these settings, such as the compression options, can be made persistent at server construction time by specifying the appropriate ChannelArguments to a grpc::ServerBuilder, via ServerBuilder::AddChannelArgument.
- Warning
- ServerContext instances should not be reused across rpcs.
Add the (key, value) pair to the initial metadata associated with a server call.
These are made available at the client side by the grpc::ClientContext::GetServerInitialMetadata() method.
- Warning
- This method should only be called before sending initial metadata to the client (which can happen explicitly, or implicitly when sending a a response message or status to the client).
- Parameters
-
| key | The metadata key. If value is binary data, it must end in "-bin". |
| value | The metadata value. If its value is binary, the key name must end in "-bin". |
Metadata must conform to the following format: Custom-Metadata -> Binary-Header / ASCII-Header Binary-Header -> {Header-Name "-bin" } {binary value} ASCII-Header -> Header-Name ASCII-Value Header-Name -> 1*( x30-39 / x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - . ASCII-Value -> 1*( x20-x7E ) ; space and printable ASCII
Add the (key, value) pair to the initial metadata associated with a server call.
These are made available at the client side by the grpc::ClientContext::GetServerTrailingMetadata() method.
- Warning
- This method should only be called before sending trailing metadata to the client (which happens when the call is finished and a status is sent to the client).
- Parameters
-
| key | The metadata key. If value is binary data, it must end in "-bin". |
| value | The metadata value. If its value is binary, the key name must end in "-bin". |
Metadata must conform to the following format: Custom-Metadata -> Binary-Header / ASCII-Header Binary-Header -> {Header-Name "-bin" } {binary value} ASCII-Header -> Header-Name ASCII-Value Header-Name -> 1*( x30-39 / x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - . ASCII-Value -> 1*( x20-x7E ) ; space and printable ASCII
Return a collection of initial metadata key-value pairs sent from the client.
Note that keys may happen more than once (ie, a std::multimap is returned).
It is safe to use this method after initial metadata has been received, Calls always begin with the client sending initial metadata, so this is safe to access as soon as the call has begun on the server side.
- Returns
- A multimap of initial metadata key-value pairs from the server.
| void grpc_impl::ServerContext::TryCancel |
( |
| ) |
const |
Cancel the Call from the server.
This is a best-effort API and depending on when it is called, the RPC may still appear successful to the client. For example, if TryCancel() is called on a separate thread, it might race with the server handler which might return success to the client before TryCancel() was even started by the thread.
It is the caller's responsibility to prevent such races and ensure that if TryCancel() is called, the serverhandler must return Status::CANCELLED. The only exception is that if the serverhandler is already returning an error status code, it is ok to not return Status::CANCELLED even if TryCancel() was called.
Note that TryCancel() does not change any of the tags that are pending on the completion queue. All pending tags will still be delivered (though their ok result may reflect the effect of cancellation).