|
class | grpc::testing::InteropServerContextInspector |
|
class | grpc::testing::ServerContextTestSpouse |
|
class | grpc::testing::DefaultReactorTestPeer |
|
class | grpc::ServerInterface |
|
class | grpc::Server |
|
template<class W , class R > |
class | grpc::ServerAsyncReader |
|
template<class W > |
class | grpc::ServerAsyncWriter |
|
template<class W > |
class | grpc::ServerAsyncResponseWriter |
|
template<class W , class R > |
class | grpc::ServerAsyncReaderWriter |
|
template<class R > |
class | grpc::ServerReader |
|
template<class W > |
class | grpc::ServerWriter |
|
template<class W , class R > |
class | grpc::internal::ServerReaderWriterBody |
|
template<class ServiceType , class RequestType , class ResponseType , class BaseRequestType , class BaseResponseType > |
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::internal::CallbackUnaryHandler |
|
template<class RequestType , class ResponseType > |
class | grpc::internal::CallbackClientStreamingHandler |
|
template<class RequestType , class ResponseType > |
class | grpc::internal::CallbackServerStreamingHandler |
|
template<class RequestType , class ResponseType > |
class | grpc::internal::CallbackBidiHandler |
|
template<grpc::StatusCode code> |
class | grpc::internal::ErrorMethodHandler |
|
template<class Base > |
class | grpc::internal::FinishOnlyReactor |
|
class | grpc::ClientContext |
|
class | grpc::GenericServerContext |
|
class | grpc::GenericCallbackServerContext |
|
template<class ResponseType > |
void | grpc::internal::UnaryRunHandlerHelper (const internal::MethodHandler::HandlerParameter ¶m, ResponseType *rsp, Status &status) |
|
Base class of ServerContext.
void grpc::ServerContextBase::AddInitialMetadata |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
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
*
void grpc::ServerContextBase::AddTrailingMetadata |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
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.
Get a library-owned default unary reactor for use in minimal reaction cases.
This supports typical unary RPC usage of providing a response and status. It supports immediate Finish (finish from within the method handler) or delayed Finish (finish called after the method handler invocation). It does not support reacting to cancellation or completion, or early sending of initial metadata. Since this is a library-owned reactor, it should not be delete'd or freed in any way. This is more efficient than creating a user-owned reactor both because of avoiding an allocation and because its minimal reactions are optimized using a core surface flag that allows their reactions to run inline without any thread-hop.
This method should not be called more than once or called after return from the method handler.
bool grpc::ServerContextBase::IsCancelled |
( |
| ) |
const |
Return whether this RPC failed before the server could provide its status back to the client.
This could be because of explicit API cancellation from the client-side or server-side, because of deadline exceeded, network connection reset, HTTP/2 parameter configuration (e.g., max message size, max connection age), etc. It does NOT include failure due to a non-OK status return from the server application's request handler, including Status::CANCELLED.
IsCancelled is always safe to call when using sync or callback API. When using async API, it is only safe to call IsCancelled after the AsyncNotifyWhenDone tag has been delivered. Thread-safe.
void grpc::ServerContextBase::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. Additionally, it is illegal to invoke TryCancel() before the call has actually begun, i.e., before metadata has been received from the client.
For reasons such as the above, it is generally preferred to explicitly finish an RPC by returning Status::CANCELLED rather than using TryCancel.
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).