Grpc.Core.Api
Asynchronous authentication interceptor for .
The interceptor context.
Metadata to populate with entries that will be added to outgoing call's headers.
Context for an RPC being intercepted by .
Initializes a new instance of AuthInterceptorContext.
The fully qualified service URL for the RPC being called.
The method name of the RPC being called.
Provides an abstraction over the callback providers
used by AsyncUnaryCall, AsyncDuplexStreamingCall, etc
Return type for client streaming calls.
Request message type for this call.
Response message type for this call.
Creates a new AsyncClientStreamingCall object with the specified properties.
Stream of request values.
The response of the asynchronous call.
Response headers of the asynchronous call.
Delegate returning the status of the call.
Delegate returning the trailing metadata of the call.
Delegate to invoke when Dispose is called on the call object.
Creates a new AsyncClientStreamingCall object with the specified properties.
Stream of request values.
The response of the asynchronous call.
Response headers of the asynchronous call.
Delegate returning the status of the call.
Delegate returning the trailing metadata of the call.
Delegate to invoke when Dispose is called on the call object.
State object for use with the callback parameters.
Asynchronous call result.
Asynchronous access to response headers.
Async stream to send streaming requests.
Gets an awaiter used to await this .
An awaiter instance.
This method is intended for compiler use rather than use directly in code.
Configures an awaiter used to await this .
true to attempt to marshal the continuation back to the original context captured; otherwise, false.
An object used to await this task.
Gets the call status if the call has already finished.
Throws InvalidOperationException otherwise.
Gets the call trailing metadata if the call has already finished.
Throws InvalidOperationException otherwise.
Provides means to cleanup after the call.
If the call has already finished normally (request stream has been completed and call result has been received), doesn't do anything.
Otherwise, requests cancellation of the call which should terminate all pending async operations associated with the call.
As a result, all resources being used by the call should be released eventually.
Normally, there is no need for you to dispose the call unless you want to utilize the
"Cancel" semantics of invoking Dispose.
Return type for bidirectional streaming calls.
Request message type for this call.
Response message type for this call.
Creates a new AsyncDuplexStreamingCall object with the specified properties.
Stream of request values.
Stream of response values.
Response headers of the asynchronous call.
Delegate returning the status of the call.
Delegate returning the trailing metadata of the call.
Delegate to invoke when Dispose is called on the call object.
Creates a new AsyncDuplexStreamingCall object with the specified properties.
Stream of request values.
Stream of response values.
Response headers of the asynchronous call.
Delegate returning the status of the call.
Delegate returning the trailing metadata of the call.
Delegate to invoke when Dispose is called on the call object.
State object for use with the callback parameters.
Async stream to read streaming responses.
Async stream to send streaming requests.
Asynchronous access to response headers.
Gets the call status if the call has already finished.
Throws InvalidOperationException otherwise.
Gets the call trailing metadata if the call has already finished.
Throws InvalidOperationException otherwise.
Provides means to cleanup after the call.
If the call has already finished normally (request stream has been completed and response stream has been fully read), doesn't do anything.
Otherwise, requests cancellation of the call which should terminate all pending async operations associated with the call.
As a result, all resources being used by the call should be released eventually.
Normally, there is no need for you to dispose the call unless you want to utilize the
"Cancel" semantics of invoking Dispose.
Return type for server streaming calls.
Response message type for this call.
Creates a new AsyncDuplexStreamingCall object with the specified properties.
Stream of response values.
Response headers of the asynchronous call.
Delegate returning the status of the call.
Delegate returning the trailing metadata of the call.
Delegate to invoke when Dispose is called on the call object.
Creates a new AsyncDuplexStreamingCall object with the specified properties.
Stream of response values.
Response headers of the asynchronous call.
Delegate returning the status of the call.
Delegate returning the trailing metadata of the call.
Delegate to invoke when Dispose is called on the call object.
State object for use with the callback parameters.
Async stream to read streaming responses.
Asynchronous access to response headers.
Gets the call status if the call has already finished.
Throws InvalidOperationException otherwise.
Gets the call trailing metadata if the call has already finished.
Throws InvalidOperationException otherwise.
Provides means to cleanup after the call.
If the call has already finished normally (response stream has been fully read), doesn't do anything.
Otherwise, requests cancellation of the call which should terminate all pending async operations associated with the call.
As a result, all resources being used by the call should be released eventually.
Normally, there is no need for you to dispose the call unless you want to utilize the
"Cancel" semantics of invoking Dispose.
Extension methods for .
Advances the stream reader to the next element in the sequence, returning the result asynchronously.
The message type.
The stream reader.
Task containing the result of the operation: true if the reader was successfully advanced
to the next element; false if the reader has passed the end of the sequence.
Return type for single request - single response call.
Response message type for this call.
Creates a new AsyncUnaryCall object with the specified properties.
The response of the asynchronous call.
Response headers of the asynchronous call.
Delegate returning the status of the call.
Delegate returning the trailing metadata of the call.
Delegate to invoke when Dispose is called on the call object.
Creates a new AsyncUnaryCall object with the specified properties.
The response of the asynchronous call.
Response headers of the asynchronous call.
Delegate returning the status of the call.
Delegate returning the trailing metadata of the call.
Delegate to invoke when Dispose is called on the call object.
State object for use with the callback parameters.
Asynchronous call result.
Asynchronous access to response headers.
Gets an awaiter used to await this .
An awaiter instance.
This method is intended for compiler use rather than use directly in code.
Configures an awaiter used to await this .
true to attempt to marshal the continuation back to the original context captured; otherwise, false.
An object used to await this task.
Gets the call status if the call has already finished.
Throws InvalidOperationException otherwise.
Gets the call trailing metadata if the call has already finished.
Throws InvalidOperationException otherwise.
Provides means to cleanup after the call.
If the call has already finished normally (request stream has been completed and call result has been received), doesn't do anything.
Otherwise, requests cancellation of the call which should terminate all pending async operations associated with the call.
As a result, all resources being used by the call should be released eventually.
Normally, there is no need for you to dispose the call unless you want to utilize the
"Cancel" semantics of invoking Dispose.
Authentication context for a call.
AuthContext is the only reliable source of truth when it comes to authenticating calls.
Using any other call/context properties for authentication purposes is wrong and inherently unsafe.
Note: experimental API that can change or be removed without any prior notice.
Initializes a new instance of the class.
Peer identity property name.
Multimap of auth properties by name.
Returns true if the peer is authenticated.
Gets the name of the property that indicates the peer identity. Returns null
if the peer is not authenticated.
Gets properties that represent the peer identity (there can be more than one). Returns an empty collection
if the peer is not authenticated.
Gets the auth properties of this context.
Returns the auth properties with given name (there can be more than one).
If no properties of given name exist, an empty collection will be returned.
A property of an .
Note: experimental API that can change or be removed without any prior notice.
Gets the name of the property.
Gets the string value of the property.
Gets the binary value of the property.
Creates an instance of AuthProperty.
the name
the binary value of the property
Gets the binary value of the property (without making a defensive copy).
Creates and instance of AuthProperty without making a defensive copy of valueBytes.
Specifies the location of the service bind method for a gRPC service.
The bind method is typically generated code and is used to register a service's
methods with the server on startup.
The bind method signature takes a and an optional
instance of the service base class, e.g. static void BindService(ServiceBinderBase, GreeterService).
Initializes a new instance of the class.
The type the service bind method is defined on.
The name of the service bind method.
Gets the type the service bind method is defined on.
Gets the name of the service bind method.
Client-side call credentials. Provide authorization with per-call granularity.
Composes multiple CallCredentials objects into
a single CallCredentials object.
credentials to compose
The new CompositeCallCredentials
Creates a new instance of CallCredentials class from an
interceptor that can attach metadata to outgoing calls.
authentication interceptor
Populates call credentials configurator with this instance's configuration.
End users never need to invoke this method as it is part of internal implementation.
Base class for objects that can consume configuration from CallCredentials objects.
Note: experimental API that can change or be removed without any prior notice.
Consumes configuration for composite call credentials.
Consumes configuration for call credentials created from AsyncAuthInterceptor
Flags to enable special call behaviors (client-side only).
The call is idempotent (retrying the call doesn't change the outcome of the operation).
If channel is in ChannelState.TransientFailure, attempt waiting for the channel to recover
instead of failing the call immediately.
The call is cacheable. gRPC is free to use GET verb */
Call invoker that throws NotImplementedException for all requests.
Abstraction of client-side RPC invocation.
Invokes a simple remote call in a blocking fashion.
Invokes a simple remote call asynchronously.
Invokes a server streaming call asynchronously.
In server streaming scenario, client sends on request and server responds with a stream of responses.
Invokes a client streaming call asynchronously.
In client streaming scenario, client sends a stream of requests and server responds with a single response.
Invokes a duplex streaming call asynchronously.
In duplex streaming scenario, client sends a stream of requests and server responds with a stream of responses.
The response stream is completely independent and both side can be sending messages at the same time.
Options for calls made by client.
Creates a new instance of CallOptions struct.
Headers to be sent with the call.
Deadline for the call to finish. null means no deadline.
Can be used to request cancellation of the call.
Write options that will be used for this call.
Context propagation token obtained from .
Credentials to use for this call.
Headers to send at the beginning of the call.
Call deadline.
Token that can be used for cancelling the call on the client side.
Cancelling the token will request cancellation
of the remote call. Best effort will be made to deliver the cancellation
notification to the server and interaction of the call with the server side
will be terminated. Unless the call finishes before the cancellation could
happen (there is an inherent race),
the call will finish with StatusCode.Cancelled status.
Write options that will be used for this call.
Token for propagating parent call context.
Credentials to use for this call.
If true and channel is in ChannelState.TransientFailure, the call will attempt waiting for the channel to recover
instead of failing immediately (which is the default "FailFast" semantics).
Note: experimental API that can change or be removed without any prior notice.
Flags to use for this call.
Returns new instance of with
Headers set to the value provided. Values of all other fields are preserved.
The headers.
Returns new instance of with
Deadline set to the value provided. Values of all other fields are preserved.
The deadline.
Returns new instance of with
CancellationToken set to the value provided. Values of all other fields are preserved.
The cancellation token.
Returns new instance of with
WriteOptions set to the value provided. Values of all other fields are preserved.
The write options.
Returns new instance of with
PropagationToken set to the value provided. Values of all other fields are preserved.
The context propagation token.
Returns new instance of with
Credentials set to the value provided. Values of all other fields are preserved.
The call credentials.
Returns new instance of with "WaitForReady" semantics enabled/disabled.
.
Note: experimental API that can change or be removed without any prior notice.
Returns new instance of with
Flags set to the value provided. Values of all other fields are preserved.
The call flags.
Base class for gRPC channel. Channels are an abstraction of long-lived connections to remote servers.
Initializes a new instance of class that connects to a specific host.
Target of the channel.
The original target used to create the channel.
Create a new for the channel.
A new .
Shuts down the channel cleanly. It is strongly recommended to shutdown
the channel once you stopped using it.
Guidance for implementors:
This method doesn't wait for all calls on this channel to finish (nor does
it have to explicitly cancel all outstanding calls). It is user's responsibility to make sure
all the calls on this channel have finished (successfully or with an error)
before shutting down the channel to ensure channel shutdown won't impact
the outcome of those remote calls.
Provides implementation of a non-virtual public member.
Client-side channel credentials. Used for creation of a secure channel.
Creates a new instance of channel credentials
Returns instance of credentials that provides no security and
will result in creating an unsecure channel with no encryption whatsoever.
Returns instance of credentials that provides SSL security.
These credentials are the same as creating without parameters.
Apps that are using Grpc.Core can create directly to customize
the secure SSL credentials.
Creates a new instance of ChannelCredentials class by composing
given channel credentials with call credentials.
Channel credentials.
Call credentials.
The new composite ChannelCredentials
Populates channel credentials configurator with this instance's configuration.
End users never need to invoke this method as it is part of internal implementation.
Returns true if this credential type allows being composed by CompositeCredentials.
Credentials that allow composing one object and
one or more objects into a single .
Initializes a new instance of CompositeChannelCredentials class.
The resulting credentials object will be composite of all the credentials specified as parameters.
channelCredentials to compose
channelCredentials to compose
Base class for objects that can consume configuration from CallCredentials objects.
Note: experimental API that can change or be removed without any prior notice.
Configures the credentials to use insecure credentials.
Configures the credentials to use SslCredentials.
Configures the credentials to use composite channel credentials (a composite of channel credentials and call credentials).
Generic base class for client-side stubs.
Initializes a new instance of ClientBase class that
throws NotImplementedException upon invocation of any RPC.
This constructor is only provided to allow creation of test doubles
for client classes (e.g. mocking requires a parameterless constructor).
Initializes a new instance of ClientBase class.
The configuration.
Initializes a new instance of ClientBase class.
The channel to use for remote call invocation.
Initializes a new instance of ClientBase class.
The CallInvoker for remote call invocation.
Creates a new client that sets host field for calls explicitly.
gRPC supports multiple "hosts" being served by a single server.
By default (if a client was not created by calling this method),
host null with the meaning "use default host" is used.
Creates a new instance of client from given ClientBaseConfiguration.
Base class for client-side stubs.
Initializes a new instance of ClientBase class that
throws NotImplementedException upon invocation of any RPC.
This constructor is only provided to allow creation of test doubles
for client classes (e.g. mocking requires a parameterless constructor).
Initializes a new instance of ClientBase class.
The configuration.
Initializes a new instance of ClientBase class.
The channel to use for remote call invocation.
Initializes a new instance of ClientBase class.
The CallInvoker for remote call invocation.
Gets the call invoker.
Gets the configuration.
Represents configuration of ClientBase. The class itself is visible to
subclasses, but contents are marked as internal to make the instances opaque.
The verbose name of this class was chosen to make name clash in generated code
less likely.
Creates a new instance of ClientBaseConfigurationInterceptor given the specified header and host interceptor function.
Options for .
The context propagation options that will be used by default.
Creates new context propagation options.
If set to true parent call's deadline will be propagated to the child call.
If set to true parent call's cancellation token will be propagated to the child call.
true if parent call's deadline should be propagated to the child call.
true if parent call's cancellation token should be propagated to the child call.
Token for propagating context of server side handlers to child calls.
In situations when a backend is making calls to another backend,
it makes sense to propagate properties like deadline and cancellation
token of the server call to the child call.
Underlying gRPC implementation may provide other "opaque" contexts (like tracing context) that
are not explicitly accesible via the public C# API, but this token still allows propagating them.
Provides access to the payload being deserialized when deserializing messages.
Get the total length of the payload in bytes.
Gets the entire payload as a newly allocated byte array.
Once the byte array is returned, the byte array becomes owned by the caller and won't be ever accessed or reused by gRPC again.
NOTE: Obtaining the buffer as a newly allocated byte array is the simplest way of accessing the payload,
but it can have important consequences in high-performance scenarios.
In particular, using this method usually requires copying of the entire buffer one extra time.
Also, allocating a new buffer each time can put excessive pressure on GC, especially if
the payload is more than 86700 bytes large (which means the newly allocated buffer will be placed in LOH,
and LOH object can only be garbage collected via a full ("stop the world") GC run).
NOTE: Deserializers are expected not to call this method (or other payload accessor methods) more than once per received message
(as there is no practical reason for doing so) and DeserializationContext implementations are free to assume so.
byte array containing the entire payload.
Gets the entire payload as a ReadOnlySequence.
The ReadOnlySequence is only valid for the duration of the deserializer routine and the caller must not access it after the deserializer returns.
Using the read only sequence is the most efficient way to access the message payload. Where possible it allows directly
accessing the received payload without needing to perform any buffer copying or buffer allocations.
NOTE: When using this method, it is recommended to use C# 7.2 compiler to make it more useful (using Span type directly from your code requires C# 7.2)."
NOTE: Deserializers are expected not to call this method (or other payload accessor methods) more than once per received message
(as there is no practical reason for doing so) and DeserializationContext implementations are free to assume so.
read only sequence containing the entire payload.
A stream of messages to be read.
Messages can be awaited await reader.MoveNext(), that returns true
if there is a message available and false if there are no more messages
(i.e. the stream has been closed).
On the client side, the last invocation of MoveNext() either returns false
if the call has finished successfully or throws RpcException if call finished
with an error. Once the call finishes, subsequent invocations of MoveNext() will
continue yielding the same result (returning false or throwing an exception).
On the server side, MoveNext() does not throw exceptions.
In case of a failure, the request stream will appear to be finished
(MoveNext will return false) and the CancellationToken
associated with the call will be cancelled to signal the failure.
MoveNext() operations can be cancelled via a cancellation token. Cancelling
an individual read operation has the same effect as cancelling the entire call
(which will also result in the read operation returning prematurely), but the per-read cancellation
tokens passed to MoveNext() only result in cancelling the call if the read operation haven't finished
yet.
The message type.
Gets the current element in the iteration.
Advances the reader to the next element in the sequence, returning the result asynchronously.
Cancellation token that can be used to cancel the operation.
Task containing the result of the operation: true if the reader was successfully advanced
to the next element; false if the reader has passed the end of the sequence.
A writable stream of messages.
The message type.
Writes a message asynchronously. Only one write can be pending at a time.
The message to be written. Cannot be null.
Write options that will be used for the next write.
If null, default options will be used.
Once set, this property maintains its value across subsequent
writes.
Client-side writable stream of messages with Close capability.
The message type.
Completes/closes the stream. Can only be called once there is no pending write. No writes should follow calling this.
Extends the CallInvoker class to provide the interceptor facility on the client side.
Returns a instance that intercepts
the invoker with the given interceptor.
The underlying invoker to intercept.
The interceptor to intercept calls to the invoker with.
Multiple interceptors can be added on top of each other by calling
"invoker.Intercept(a, b, c)". The order of invocation will be "a", "b", and then "c".
Interceptors can be later added to an existing intercepted CallInvoker, effectively
building a chain like "invoker.Intercept(c).Intercept(b).Intercept(a)". Note that
in this case, the last interceptor added will be the first to take control.
Returns a instance that intercepts
the invoker with the given interceptors.
The channel to intercept.
An array of interceptors to intercept the calls to the invoker with.
Control is passed to the interceptors in the order specified.
Multiple interceptors can be added on top of each other by calling
"invoker.Intercept(a, b, c)". The order of invocation will be "a", "b", and then "c".
Interceptors can be later added to an existing intercepted CallInvoker, effectively
building a chain like "invoker.Intercept(c).Intercept(b).Intercept(a)". Note that
in this case, the last interceptor added will be the first to take control.
Returns a instance that intercepts
the invoker with the given interceptor.
The underlying invoker to intercept.
An interceptor delegate that takes the request metadata to be sent with an outgoing call
and returns a instance that will replace the existing
invocation metadata.
Multiple interceptors can be added on top of each other by
building a chain like "invoker.Intercept(c).Intercept(b).Intercept(a)". Note that
in this case, the last interceptor added will be the first to take control.
Creates a new instance of MetadataInterceptor given the specified interceptor function.
Provides extension methods to make it easy to register interceptors on Channel objects.
Returns a instance that intercepts
the channel with the given interceptor.
The channel to intercept.
The interceptor to intercept the channel with.
Multiple interceptors can be added on top of each other by calling
"channel.Intercept(a, b, c)". The order of invocation will be "a", "b", and then "c".
Interceptors can be later added to an existing intercepted channel, effectively
building a chain like "channel.Intercept(c).Intercept(b).Intercept(a)". Note that
in this case, the last interceptor added will be the first to take control.
Returns a instance that intercepts
the channel with the given interceptors.
The channel to intercept.
An array of interceptors to intercept the channel with.
Control is passed to the interceptors in the order specified.
Multiple interceptors can be added on top of each other by calling
"channel.Intercept(a, b, c)". The order of invocation will be "a", "b", and then "c".
Interceptors can be later added to an existing intercepted channel, effectively
building a chain like "channel.Intercept(c).Intercept(b).Intercept(a)". Note that
in this case, the last interceptor added will be the first to take control.
Returns a instance that intercepts
the invoker with the given interceptor.
The channel to intercept.
An interceptor delegate that takes the request metadata to be sent with an outgoing call
and returns a instance that will replace the existing
invocation metadata.
Multiple interceptors can be added on top of each other by
building a chain like "channel.Intercept(c).Intercept(b).Intercept(a)". Note that
in this case, the last interceptor added will be the first to take control.
Carries along the context associated with intercepted invocations on the client side.
Creates a new instance of
with the specified method, host, and call options.
A object representing the method to be invoked.
The host to dispatch the current call to.
A instance containing the call options of the current call.
Gets the instance
representing the method to be invoked.
Gets the host that the currect invocation will be dispatched to.
Gets the structure representing the
call options associated with the current invocation.
Decorates an underlying to
intercept calls through a given interceptor.
Creates a new instance of
with the given underlying invoker and interceptor instances.
Intercepts a simple blocking call with the registered interceptor.
Intercepts a simple asynchronous call with the registered interceptor.
Intercepts an asynchronous server streaming call with the registered interceptor.
Intercepts an asynchronous client streaming call with the registered interceptor.
Intercepts an asynchronous duplex streaming call with the registered interceptor.
Serves as the base class for gRPC interceptors.
Represents a continuation for intercepting simple blocking invocations.
A delegate of this type is passed to the BlockingUnaryCall method
when an outgoing invocation is being intercepted and calling the
delegate will invoke the next interceptor in the chain, or the underlying
call invoker if called from the last interceptor. The interceptor is
allowed to call it zero, one, or multiple times, passing it the appropriate
context and request values as it sees fit.
Request message type for this invocation.
Response message type for this invocation.
The request value to continue the invocation with.
The
instance to pass to the next step in the invocation process.
The response value of the invocation to return to the caller.
The interceptor can choose to return the return value of the
continuation delegate or an arbitrary value as it sees fit.
Represents a continuation for intercepting simple asynchronous invocations.
A delegate of this type is passed to the AsyncUnaryCall method
when an outgoing invocation is being intercepted and calling the
delegate will invoke the next interceptor in the chain, or the underlying
call invoker if called from the last interceptor. The interceptor is
allowed to call it zero, one, or multiple times, passing it the appropriate
request value and context as it sees fit.
Request message type for this invocation.
Response message type for this invocation.
The request value to continue the invocation with.
The
instance to pass to the next step in the invocation process.
An instance of
representing an asynchronous invocation of a unary RPC.
The interceptor can choose to return the same object returned from
the continuation delegate or an arbitrarily constructed instance as it sees fit.
Represents a continuation for intercepting asynchronous server-streaming invocations.
A delegate of this type is passed to the AsyncServerStreamingCall method
when an outgoing invocation is being intercepted and calling the
delegate will invoke the next interceptor in the chain, or the underlying
call invoker if called from the last interceptor. The interceptor is
allowed to call it zero, one, or multiple times, passing it the appropriate
request value and context as it sees fit.
Request message type for this invocation.
Response message type for this invocation.
The request value to continue the invocation with.
The
instance to pass to the next step in the invocation process.
An instance of
representing an asynchronous invocation of a server-streaming RPC.
The interceptor can choose to return the same object returned from
the continuation delegate or an arbitrarily constructed instance as it sees fit.
Represents a continuation for intercepting asynchronous client-streaming invocations.
A delegate of this type is passed to the AsyncClientStreamingCall method
when an outgoing invocation is being intercepted and calling the
delegate will invoke the next interceptor in the chain, or the underlying
call invoker if called from the last interceptor. The interceptor is
allowed to call it zero, one, or multiple times, passing it the appropriate
request value and context as it sees fit.
Request message type for this invocation.
Response message type for this invocation.
The
instance to pass to the next step in the invocation process.
An instance of
representing an asynchronous invocation of a client-streaming RPC.
The interceptor can choose to return the same object returned from
the continuation delegate or an arbitrarily constructed instance as it sees fit.
Represents a continuation for intercepting asynchronous duplex invocations.
A delegate of this type is passed to the AsyncDuplexStreamingCall method
when an outgoing invocation is being intercepted and calling the
delegate will invoke the next interceptor in the chain, or the underlying
call invoker if called from the last interceptor. The interceptor is
allowed to call it zero, one, or multiple times, passing it the appropriate
request value and context as it sees fit.
The
instance to pass to the next step in the invocation process.
An instance of
representing an asynchronous invocation of a duplex-streaming RPC.
The interceptor can choose to return the same object returned from
the continuation delegate or an arbitrarily constructed instance as it sees fit.
Intercepts a blocking invocation of a simple remote call.
The request message of the invocation.
The
associated with the current invocation.
The callback that continues the invocation process.
This can be invoked zero or more times by the interceptor.
The interceptor can invoke the continuation passing the given
request value and context arguments, or substitute them as it sees fit.
The response message of the current invocation.
The interceptor can simply return the return value of the
continuation delegate passed to it intact, or an arbitrary
value as it sees fit.
Intercepts an asynchronous invocation of a simple remote call.
The request message of the invocation.
The
associated with the current invocation.
The callback that continues the invocation process.
This can be invoked zero or more times by the interceptor.
The interceptor can invoke the continuation passing the given
request value and context arguments, or substitute them as it sees fit.
An instance of
representing an asynchronous unary invocation.
The interceptor can simply return the return value of the
continuation delegate passed to it intact, or construct its
own substitute as it sees fit.
Intercepts an asynchronous invocation of a streaming remote call.
The request message of the invocation.
The
associated with the current invocation.
The callback that continues the invocation process.
This can be invoked zero or more times by the interceptor.
The interceptor can invoke the continuation passing the given
request value and context arguments, or substitute them as it sees fit.
An instance of
representing an asynchronous server-streaming invocation.
The interceptor can simply return the return value of the
continuation delegate passed to it intact, or construct its
own substitute as it sees fit.
Intercepts an asynchronous invocation of a client streaming call.
The
associated with the current invocation.
The callback that continues the invocation process.
This can be invoked zero or more times by the interceptor.
The interceptor can invoke the continuation passing the given
context argument, or substitute as it sees fit.
An instance of
representing an asynchronous client-streaming invocation.
The interceptor can simply return the return value of the
continuation delegate passed to it intact, or construct its
own substitute as it sees fit.
Intercepts an asynchronous invocation of a duplex streaming call.
The
associated with the current invocation.
The callback that continues the invocation process.
This can be invoked zero or more times by the interceptor.
The interceptor can invoke the continuation passing the given
context argument, or substitute as it sees fit.
An instance of
representing an asynchronous duplex-streaming invocation.
The interceptor can simply return the return value of the
continuation delegate passed to it intact, or construct its
own substitute as it sees fit.
Server-side handler for intercepting and incoming unary call.
Request message type for this method.
Response message type for this method.
The request value of the incoming invocation.
An instance of representing
the context of the invocation.
A delegate that asynchronously proceeds with the invocation, calling
the next interceptor in the chain, or the service request handler,
in case of the last interceptor and return the response value of
the RPC. The interceptor can choose to call it zero or more times
at its discretion.
A future representing the response value of the RPC. The interceptor
can simply return the return value from the continuation intact,
or an arbitrary response value as it sees fit.
Server-side handler for intercepting client streaming call.
Request message type for this method.
Response message type for this method.
The request stream of the incoming invocation.
An instance of representing
the context of the invocation.
A delegate that asynchronously proceeds with the invocation, calling
the next interceptor in the chain, or the service request handler,
in case of the last interceptor and return the response value of
the RPC. The interceptor can choose to call it zero or more times
at its discretion.
A future representing the response value of the RPC. The interceptor
can simply return the return value from the continuation intact,
or an arbitrary response value as it sees fit. The interceptor has
the ability to wrap or substitute the request stream when calling
the continuation.
Server-side handler for intercepting server streaming call.
Request message type for this method.
Response message type for this method.
The request value of the incoming invocation.
The response stream of the incoming invocation.
An instance of representing
the context of the invocation.
A delegate that asynchronously proceeds with the invocation, calling
the next interceptor in the chain, or the service request handler,
in case of the last interceptor and the interceptor can choose to
call it zero or more times at its discretion. The interceptor has
the ability to wrap or substitute the request value and the response stream
when calling the continuation.
Server-side handler for intercepting bidirectional streaming calls.
Request message type for this method.
Response message type for this method.
The request stream of the incoming invocation.
The response stream of the incoming invocation.
An instance of representing
the context of the invocation.
A delegate that asynchronously proceeds with the invocation, calling
the next interceptor in the chain, or the service request handler,
in case of the last interceptor and the interceptor can choose to
call it zero or more times at its discretion. The interceptor has
the ability to wrap or substitute the request and response streams
when calling the continuation.
A writable stream of messages that is used in server-side handlers.
Key certificate pair (in PEM encoding).
Creates a new certificate chain - private key pair.
PEM encoded certificate chain.
PEM encoded private key.
PEM encoded certificate chain.
PEM encoded private key.
Encapsulates the logic for serializing and deserializing messages.
Initializes a new marshaller from simple serialize/deserialize functions.
Function that will be used to serialize messages.
Function that will be used to deserialize messages.
Initializes a new marshaller from serialize/deserialize fuctions that can access serialization and deserialization
context. Compared to the simple serializer/deserializer functions, using the contextual version provides more
flexibility and can lead to increased efficiency (and better performance).
Note: This constructor is part of an experimental API that can change or be removed without any prior notice.
Function that will be used to serialize messages.
Function that will be used to deserialize messages.
Gets the serializer function.
Gets the deserializer function.
Gets the serializer function.
Note: experimental API that can change or be removed without any prior notice.
Gets the serializer function.
Note: experimental API that can change or be removed without any prior notice.
Utilities for creating marshallers.
Creates a marshaller from specified serializer and deserializer.
Creates a marshaller from specified contextual serializer and deserializer.
Note: This method is part of an experimental API that can change or be removed without any prior notice.
Returns a marshaller for string type. This is useful for testing.
A collection of metadata entries that can be exchanged during a call.
gRPC supports these types of metadata:
- Request headersare sent by the client at the beginning of a remote call before any request messages are sent.
- Response headersare sent by the server at the beginning of a remote call handler before any response messages are sent.
- Response trailersare sent by the server at the end of a remote call along with resulting call status.
All binary headers should have this suffix.
An read-only instance of metadata containing no entries.
To be used in initial metadata to request specific compression algorithm
for given call. Direct selection of compression algorithms is an internal
feature and is not part of public API.
Initializes a new instance of Metadata.
Makes this object read-only.
this object
Gets the last metadata entry with the specified key.
If there are no matching entries then null is returned.
Gets the string value of the last metadata entry with the specified key.
If the metadata entry is binary then an exception is thrown.
If there are no matching entries then null is returned.
Gets the bytes value of the last metadata entry with the specified key.
If the metadata entry is not binary the string value will be returned as ASCII encoded bytes.
If there are no matching entries then null is returned.
Gets all metadata entries with the specified key.
Adds a new ASCII-valued metadata entry. See Metadata.Entry constructor for params.
Adds a new binary-valued metadata entry. See Metadata.Entry constructor for params.
Metadata entry
Initializes a new instance of the struct with a binary value.
Metadata key. Gets converted to lowercase. Needs to have suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores, hyphens and dots.
Value bytes.
Initializes a new instance of the struct with an ASCII value.
Metadata key. Gets converted to lowercase. Must not use suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores, hyphens and dots.
Value string. Only ASCII characters are allowed.
Gets the metadata entry key.
Gets the binary value of this metadata entry.
If the metadata entry is not binary the string value will be returned as ASCII encoded bytes.
Gets the string value of this metadata entry.
If the metadata entry is binary then an exception is thrown.
Returns true if this entry is a binary-value entry.
Returns a that represents the current .
Gets the serialized value for this entry. For binary metadata entries, this leaks
the internal valueBytes byte array and caller must not change contents of it.
Creates a binary value or ascii value metadata entry from data received from the native layer.
We trust C core to give us well-formed data, so we don't perform any checks or defensive copying.
Returns true if the key has "-bin" binary header suffix.
Method types supported by gRPC.
Single request sent from client, single response received from server.
Stream of request sent from client, single response received from server.
Single request sent from client, stream of responses received from server.
Both server and client can stream arbitrary number of requests and responses simultaneously.
A non-generic representation of a remote method.
Gets the type of the method.
Gets the name of the service to which this method belongs.
Gets the unqualified name of the method.
Gets the fully qualified name of the method. On the server side, methods are dispatched
based on this name.
A description of a remote method.
Request message type for this method.
Response message type for this method.
Initializes a new instance of the Method class.
Type of method.
Name of service this method belongs to.
Unqualified name of the method.
Marshaller used for request messages.
Marshaller used for response messages.
Gets the type of the method.
Gets the name of the service to which this method belongs.
Gets the unqualified name of the method.
Gets the marshaller used for request messages.
Gets the marshaller used for response messages.
Gets the fully qualified name of the method. On the server side, methods are dispatched
based on this name.
Gets full name of the method including the service name.
Thrown when remote procedure call fails. Every RpcException is associated with a resulting of the call.
Creates a new RpcException associated with given status.
Resulting status of a call.
Creates a new RpcException associated with given status and message.
NOTE: the exception message is not sent to the remote peer. Use status.Details to pass error
details to the peer.
Resulting status of a call.
The exception message.
Creates a new RpcException associated with given status and trailing response metadata.
Resulting status of a call.
Response trailing metadata.
Creates a new RpcException associated with given status, message and trailing response metadata.
NOTE: the exception message is not sent to the remote peer. Use status.Details to pass error
details to the peer.
Resulting status of a call.
Response trailing metadata.
The exception message.
Resulting status of the call.
Returns the status code of the call, as a convenient alternative to Status.StatusCode.
Gets the call trailing metadata.
Trailers only have meaningful content for client-side calls (in which case they represent the trailing metadata sent by the server when closing the call).
Instances of RpcException thrown by the server-side part of the stack will have trailers always set to empty.
Provides storage for payload when serializing a message.
Use the byte array as serialized form of current message and mark serialization process as complete.
Complete(byte[]) can only be called once. By calling this method the caller gives up the ownership of the
payload which must not be accessed afterwards.
the serialized form of current message
Gets buffer writer that can be used to write the serialized data. Once serialization is finished,
Complete() needs to be called.
Sets the payload length when writing serialized data into a buffer writer. If the serializer knows the full payload
length in advance, providing that information before obtaining the buffer writer using GetBufferWriter() can improve
serialization efficiency by avoiding copies. The provided payload length must be the same as the data written to the writer.
Calling this method is optional. If the payload length is not set then the length is calculated using the data written to
the buffer writer when Complete() is called.
The total length of the payload in bytes.
Complete the payload written to the buffer writer. Complete() can only be called once.
Context for a server-side call.
Creates a new instance of ServerCallContext.
Asynchronously sends response headers for the current call to the client. This method may only be invoked once for each call and needs to be invoked
before any response messages are written. Writing the first response message implicitly sends empty response headers if WriteResponseHeadersAsync haven't
been called yet.
The response headers to send.
The task that finished once response headers have been written.
Creates a propagation token to be used to propagate call context to a child call.
Name of method called in this RPC.
Name of host called in this RPC.
Address of the remote endpoint in URI format.
Deadline for this RPC. The call will be automatically cancelled once the deadline is exceeded.
Initial metadata sent by client.
Cancellation token signals when call is cancelled. It is also triggered when the deadline is exceeeded or there was some other error (e.g. network problem).
Trailers to send back to client after RPC finishes.
Status to send back to client after RPC finishes.
Allows setting write options for the following write.
For streaming response calls, this property is also exposed as on IServerStreamWriter for convenience.
Both properties are backed by the same underlying value.
Gets the AuthContext associated with this call.
Note: Access to AuthContext is an experimental API that can change without any prior notice.
Gets a dictionary that can be used by the various interceptors and handlers of this
call to store arbitrary state.
Provides implementation of a non-virtual public member.
Provides implementation of a non-virtual public member.
Provides implementation of a non-virtual public member.
Provides implementation of a non-virtual public member.
Provides implementation of a non-virtual public member.
Provides implementation of a non-virtual public member.
Provides implementation of a non-virtual public member.
Provides implementation of a non-virtual public member.
Provides implementation of a non-virtual public member.
Provides implementation of a non-virtual public member.
Provides implementation of a non-virtual public member.
Provides implementation of a non-virtual public member.
Provides implementation of a non-virtual public member.
Server-side handler for unary call.
Request message type for this method.
Response message type for this method.
Server-side handler for client streaming call.
Request message type for this method.
Response message type for this method.
Server-side handler for server streaming call.
Request message type for this method.
Response message type for this method.
Server-side handler for bidi streaming call.
Request message type for this method.
Response message type for this method.
Stores mapping of methods to server call handlers.
Normally, the ServerServiceDefinition objects will be created by the BindService factory method
that is part of the autogenerated code for a protocol buffers service definition.
Forwards all the previously stored AddMethod calls to the service binder.
Creates a new builder object for ServerServiceDefinition.
The builder object.
Builder class for .
Creates a new instance of builder.
Adds a definition for a single request - single response method.
The request message class.
The response message class.
The method.
The method handler.
This builder instance.
Adds a definition for a client streaming method.
The request message class.
The response message class.
The method.
The method handler.
This builder instance.
Adds a definition for a server streaming method.
The request message class.
The response message class.
The method.
The method handler.
This builder instance.
Adds a definition for a bidirectional streaming method.
The request message class.
The response message class.
The method.
The method handler.
This builder instance.
Creates an immutable ServerServiceDefinition from this builder.
The ServerServiceDefinition object.
Allows binding server-side method implementations in alternative serving stacks.
Instances of this class are usually populated by the BindService method
that is part of the autogenerated code for a protocol buffers service definition.
Adds a definition for a single request - single response method.
The request message class.
The response message class.
The method.
The method handler.
Adds a definition for a client streaming method.
The request message class.
The response message class.
The method.
The method handler.
Adds a definition for a server streaming method.
The request message class.
The response message class.
The method.
The method handler.
Adds a definition for a bidirectional streaming method.
The request message class.
The response message class.
The method.
The method handler.
Callback invoked with the expected targetHost and the peer's certificate.
If false is returned by this callback then it is treated as a
verification failure and the attempted connection will fail.
Invocation of the callback is blocking, so any
implementation should be light-weight.
Note that the callback can potentially be invoked multiple times,
concurrently from different threads (e.g. when multiple connections
are being created for the same credentials).
The associated with the callback
true if verification succeeded, false otherwise.
Note: experimental API that can change or be removed without any prior notice.
Client-side SSL credentials.
Creates client-side SSL credentials loaded from
disk file pointed to by the GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable.
If that fails, gets the roots certificates from a well known place on disk.
Creates client-side SSL credentials from
a string containing PEM encoded root certificates.
Creates client-side SSL credentials.
string containing PEM encoded server root certificates.
a key certificate pair.
Creates client-side SSL credentials.
string containing PEM encoded server root certificates.
a key certificate pair.
a callback to verify peer's target name and certificate.
Note: experimental API that can change or be removed without any prior notice.
PEM encoding of the server root certificates.
Client side key and certificate pair.
If null, client will not use key and certificate pair.
Populates channel credentials configurator with this instance's configuration.
End users never need to invoke this method as it is part of internal implementation.
Represents RPC result, which consists of and an optional detail string.
Default result of a successful RPC. StatusCode=OK, empty details message.
Default result of a cancelled RPC. StatusCode=Cancelled, empty details message.
Creates a new instance of Status.
Status code.
Detail.
Creates a new instance of Status.
Users should not use this constructor, except for creating instances for testing.
The debug error string should only be populated by gRPC internals.
Note: experimental API that can change or be removed without any prior notice.
Status code.
Detail.
Optional internal error details.
Gets the gRPC status code. OK indicates success, all other values indicate an error.
Gets the detail.
In case of an error, this field may contain additional error details to help with debugging.
This field will be only populated on a client and its value is generated locally,
based on the internal state of the gRPC client stack (i.e. the value is never sent over the wire).
Note that this field is available only for debugging purposes, the application logic should
never rely on values of this field (it should use StatusCode and Detail instead).
Example: when a client fails to connect to a server, this field may provide additional details
why the connection to the server has failed.
Note: experimental API that can change or be removed without any prior notice.
Returns a that represents the current .
Result of a remote procedure call.
Based on grpc_status_code from grpc/status.h
Not an error; returned on success.
The operation was cancelled (typically by the caller).
Unknown error. An example of where this error may be returned is
if a Status value received from another address space belongs to
an error-space that is not known in this address space. Also
errors raised by APIs that do not return enough error information
may be converted to this error.
Client specified an invalid argument. Note that this differs
from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments
that are problematic regardless of the state of the system
(e.g., a malformed file name).
Deadline expired before operation could complete. For operations
that change the state of the system, this error may be returned
even if the operation has completed successfully. For example, a
successful response from a server could have been delayed long
enough for the deadline to expire.
Some requested entity (e.g., file or directory) was not found.
Some entity that we attempted to create (e.g., file or directory) already exists.
The caller does not have permission to execute the specified
operation. PERMISSION_DENIED must not be used for rejections
caused by exhausting some resource (use RESOURCE_EXHAUSTED
instead for those errors). PERMISSION_DENIED must not be
used if the caller can not be identified (use UNAUTHENTICATED
instead for those errors).
The request does not have valid authentication credentials for the operation.
Some resource has been exhausted, perhaps a per-user quota, or
perhaps the entire file system is out of space.
Operation was rejected because the system is not in a state
required for the operation's execution. For example, directory
to be deleted may be non-empty, an rmdir operation is applied to
a non-directory, etc.
The operation was aborted, typically due to a concurrency issue
like sequencer check failures, transaction aborts, etc.
Operation was attempted past the valid range. E.g., seeking or
reading past end of file.
Operation is not implemented or not supported/enabled in this service.
Internal errors. Means some invariants expected by underlying
system has been broken. If you see one of these errors,
something is very broken.
The service is currently unavailable. This is a most likely a
transient condition and may be corrected by retrying with
a backoff. Note that it is not always safe to retry
non-idempotent operations.
Unrecoverable data loss or corruption.
Converts byte* pointing to an encoded byte array to a string using the provided Encoding.
Converts IntPtr pointing to a encoded byte array to a string using the provided Encoding.
Utility methods to simplify checking preconditions in the code.
Throws if condition is false.
The condition.
Throws with given message if condition is false.
The condition.
The error message.
Throws if reference is null.
The reference.
Throws if reference is null.
The reference.
The parameter name.
Throws if condition is false.
The condition.
Throws with given message if condition is false.
The condition.
The error message.
Verification context for VerifyPeerCallback.
Note: experimental API that can change or be removed without any prior notice.
Initializes a new instance of the class.
The target name of the peer.
The PEM encoded certificate of the peer.
The target name of the peer.
The PEM encoded certificate of the peer.
Provides info about current version of gRPC.
See https://codingforsmarties.wordpress.com/2016/01/21/how-to-version-assemblies-destined-for-nuget/
for rationale about assembly versioning.
Current AssemblyVersion attribute of gRPC C# assemblies
Current AssemblyFileVersion of gRPC C# assemblies
Current version of gRPC C#
Flags for write operations.
Hint that the write may be buffered and need not go out on the wire immediately.
gRPC is free to buffer the message until the next non-buffered
write, or until write stream completion, but it need not buffer completely or at all.
Force compression to be disabled for a particular write.
Options for write operations.
Default write options.
Initializes a new instance of WriteOptions class.
The write flags.
Gets the write flags.
Indicates that certain members on a specified are accessed dynamically,
for example through .
This allows tools to understand which members are being accessed during the execution
of a program.
This attribute is valid on members whose type is or .
When this attribute is applied to a location of type , the assumption is
that the string represents a fully qualified type name.
If the attribute is applied to a method it's treated as a special case and it implies
the attribute should be applied to the "this" parameter of the method. As such the attribute
should only be used on instance methods of types assignable to System.Type (or string, but no methods
will use it there).
Initializes a new instance of the class
with the specified member types.
The types of members dynamically accessed.
Gets the which specifies the type
of members dynamically accessed.
Specifies the types of members that are dynamically accessed.
This enumeration has a attribute that allows a
bitwise combination of its member values.
Specifies no members.
Specifies the default, parameterless public constructor.
Specifies all public constructors.
Specifies all non-public constructors.
Specifies all public methods.
Specifies all non-public methods.
Specifies all public fields.
Specifies all non-public fields.
Specifies all public nested types.
Specifies all non-public nested types.
Specifies all public properties.
Specifies all non-public properties.
Specifies all public events.
Specifies all non-public events.
Specifies all members.