Grpc.Core
Details about a client-side call to be invoked.
Request message type for the call.
Response message type for the call.
Initializes a new instance of the struct.
Channel to use for this call.
Method to call.
Call options.
Initializes a new instance of the struct.
Channel to use for this call.
Method to call.
Host that contains the method. if null, default host will be used.
Call options.
Initializes a new instance of the struct.
Channel to use for this call.
Qualified method name.
Host that contains the method.
Request marshaller.
Response marshaller.
Call options.
Get channel associated with this call.
Gets name of method to be called.
Get name of host.
Gets marshaller used to serialize requests.
Gets marshaller used to deserialized responses.
Gets the call options.
Returns new instance of with
Options set to the value provided. Values of all other fields are preserved.
Helper methods for generated clients to make RPC calls.
Most users will use this class only indirectly and will be
making calls using client object generated from protocol
buffer definition files.
Invokes a simple remote call in a blocking fashion.
The response.
The call defintion.
Request message.
Type of request message.
The of response message.
Invokes a simple remote call asynchronously.
An awaitable call object providing access to the response.
The call defintion.
Request message.
Type of request message.
The of response message.
Invokes a server streaming call asynchronously.
In server streaming scenario, client sends on request and server responds with a stream of responses.
A call object providing access to the asynchronous response stream.
The call defintion.
Request message.
Type of request message.
The of response messages.
Invokes a client streaming call asynchronously.
In client streaming scenario, client sends a stream of requests and server responds with a single response.
The call defintion.
An awaitable call object providing access to the response.
Type of request messages.
The of response message.
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.
A call object providing access to the asynchronous request and response streams.
The call definition.
Type of request messages.
Type of reponse messages.
Represents a gRPC channel. Channels are an abstraction of long-lived connections to remote servers.
More client objects can reuse the same channel. Creating a channel is an expensive operation compared to invoking
a remote call so in general you should reuse a single channel for as many calls as possible.
Creates a channel that connects to a specific host.
Port will default to 80 for an unsecure channel and to 443 for a secure channel.
Target of the channel.
Credentials to secure the channel.
Creates a channel that connects to a specific host.
Port will default to 80 for an unsecure channel or to 443 for a secure channel.
Target of the channel.
Credentials to secure the channel.
Channel options.
Creates a channel that connects to a specific host and port.
The name or IP address of the host.
The port.
Credentials to secure the channel.
Creates a channel that connects to a specific host and port.
The name or IP address of the host.
The port.
Credentials to secure the channel.
Channel options.
Gets current connectivity state of this channel.
After channel has been shutdown, ChannelState.Shutdown will be returned.
Returned tasks completes once channel state has become different from
given lastObservedState.
If deadline is reached or an error occurs, returned task is cancelled.
Returned tasks completes once channel state has become different from
given lastObservedState (true is returned) or if the wait has timed out (false is returned).
Resolved address of the remote endpoint in URI format.
The original target used to create the channel.
Returns a token that gets cancelled once ShutdownAsync is invoked.
Allows explicitly requesting channel to connect without starting an RPC.
Returned task completes once state Ready was seen. If the deadline is reached,
or channel enters the Shutdown state, the task is cancelled.
There is no need to call this explicitly unless your use case requires that.
Starting an RPC on a new channel will request connection implicitly.
The deadline. null indicates no deadline.
Shuts down the channel cleanly. It is strongly recommended to shutdown
all previously created channels before exiting from the process.
This method doesn't wait for all calls on this channel to finish (nor does
it 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.
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.
Creates a new instance of ChannelCredentials class by composing
given channel credentials with call credentials.
Channel credentials.
Call credentials.
The new composite ChannelCredentials
Gets native object for the credentials, creating one if it already doesn't exist. May return null if insecure channel
should be created. Caller must not call Dispose() on the returned native credentials as their lifetime
is managed by this class (and instances of native credentials are cached).
The native credentials.
Creates a new native object for the credentials. May return null if insecure channel
should be created. For internal use only, use instead.
The native credentials.
Returns true if this credential type allows being composed by CompositeCredentials.
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.
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
Channel option specified when creating a channel.
Corresponds to grpc_channel_args from grpc/grpc.h.
Commonly used channel option names are defined in ChannelOptions,
but any of the GRPC_ARG_* channel options names defined in grpc_types.h can be used.
Type of ChannelOption.
Channel option with integer value.
Channel option with string value.
Creates a channel option with a string value.
Name.
String value.
Creates a channel option with an integer value.
Name.
Integer value.
Gets the type of the ChannelOption.
Gets the name of the ChannelOption.
Gets the integer value the ChannelOption.
Gets the string value the ChannelOption.
Determines whether the specified object is equal to the current object.
Determines whether the specified object is equal to the current object.
A hash code for the current object.
Equality operator.
Inequality operator.
Defines names of most commonly used channel options.
Other supported options names can be found in grpc_types.h (GRPC_ARG_* definitions)
Override SSL target check. Only to be used for testing.
Enable census for tracing and stats collection
Maximum number of concurrent incoming streams to allow on a http2 connection
Maximum message length that the channel can receive
Maximum message length that the channel can send
Obsolete, for backward compatibility only.
Initial sequence number for http2 transports
Default authority for calls.
Primary user agent: goes at the start of the user-agent metadata
Secondary user agent: goes at the end of the user-agent metadata
If non-zero, allow the use of SO_REUSEPORT for server if it's available (default 1)
Creates native object for a collection of channel options.
The native channel arguments.
Connectivity state of a channel.
Based on grpc_connectivity_state from grpc/grpc.h
Channel is idle
Channel is connecting
Channel is ready for work
Channel has seen a failure but expects to recover
Channel has seen a failure that it cannot recover from
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.
Compression level based on grpc_compression_level from grpc/compression.h
No compression.
Low compression.
Medium compression.
High compression.
Invokes client RPCs using .
Initializes a new instance of the class.
Channel to use.
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.
Creates call invocation details for given method.
Encapsulates initialization and shutdown of gRPC library.
Returns a reference-counted instance of initialized gRPC environment.
Subsequent invocations return the same instance unless reference count has dropped to zero previously.
Decrements the reference count for currently active environment and asynchronously shuts down the gRPC environment if reference count drops to zero.
Requests shutdown of all channels created by the current process.
Requests immediate shutdown of all servers created by the current process.
Gets application-wide logger used by gRPC.
The logger.
Sets the application-wide logger that should be used by gRPC.
Sets the number of threads in the gRPC thread pool that polls for internal RPC events.
Can be only invoked before the GrpcEnviroment is started and cannot be changed afterwards.
Setting thread pool size is an advanced setting and you should only use it if you know what you are doing.
Most users should rely on the default value provided by gRPC library.
Note: this method is part of an experimental API that can change or be removed without any prior notice.
Sets the number of completion queues in the gRPC thread pool that polls for internal RPC events.
Can be only invoked before the GrpcEnviroment is started and cannot be changed afterwards.
Setting the number of completions queues is an advanced setting and you should only use it if you know what you are doing.
Most users should rely on the default value provided by gRPC library.
Note: this method is part of an experimental API that can change or be removed without any prior notice.
By default, gRPC's internal event handlers get offloaded to .NET default thread pool thread (inlineHandlers=false).
Setting inlineHandlers to true will allow scheduling the event handlers directly to
GrpcThreadPool internal threads. That can lead to significant performance gains in some situations,
but requires user to never block in async code (incorrectly written code can easily lead to deadlocks).
Inlining handlers is an advanced setting and you should only use it if you know what you are doing.
Most users should rely on the default value provided by gRPC library.
Note: this method is part of an experimental API that can change or be removed without any prior notice.
Note: inlineHandlers=true was the default in gRPC C# v1.4.x and earlier.
Sets the parameters for a pool that caches batch context instances. Reusing batch context instances
instead of creating a new one for every C core operation helps reducing the GC pressure.
Can be only invoked before the GrpcEnviroment is started and cannot be changed afterwards.
This is an advanced setting and you should only use it if you know what you are doing.
Most users should rely on the default value provided by gRPC library.
Note: this method is part of an experimental API that can change or be removed without any prior notice.
Sets the parameters for a pool that caches request call context instances. Reusing request call context instances
instead of creating a new one for every requested call in C core helps reducing the GC pressure.
Can be only invoked before the GrpcEnviroment is started and cannot be changed afterwards.
This is an advanced setting and you should only use it if you know what you are doing.
Most users should rely on the default value provided by gRPC library.
Note: this method is part of an experimental API that can change or be removed without any prior notice.
Occurs when GrpcEnvironment is about the start the shutdown logic.
If GrpcEnvironment is later initialized and shutdown, the event will be fired again (unless unregistered first).
Creates gRPC environment.
Gets the completion queues used by this gRPC environment.
Picks a completion queue in a round-robin fashion.
Shouldn't be invoked on a per-call basis (used at per-channel basis).
Gets the completion queue used by this gRPC environment.
Gets version of gRPC C core.
Shuts down this environment.
Handler for AppDomain.DomainUnload, AppDomain.ProcessExit and AssemblyLoadContext.Unloading hooks.
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.
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.
Extends the ServerServiceDefinition class to add methods used to register interceptors on the server side.
Returns a instance that
intercepts incoming calls to the underlying service handler through the given interceptor.
The instance to register interceptors on.
The interceptor to intercept the incoming invocations with.
Multiple interceptors can be added on top of each other by calling
"serverServiceDefinition.Intercept(a, b, c)". The order of invocation will be "a", "b", and then "c".
Interceptors can be later added to an existing intercepted service definition, effectively
building a chain like "serverServiceDefinition.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 incoming calls to the underlying service handler through the given interceptors.
The instance to register interceptors on.
An array of interceptors to intercept the incoming invocations with.
Control is passed to the interceptors in the order specified.
Multiple interceptors can be added on top of each other by calling
"serverServiceDefinition.Intercept(a, b, c)". The order of invocation will be "a", "b", and then "c".
Interceptors can be later added to an existing intercepted service definition, effectively
building a chain like "serverServiceDefinition.Intercept(c).Intercept(b).Intercept(a)". Note that
in this case, the last interceptor added will be the first to take control.
Helper for creating ServerServiceDefinition with intercepted handlers.
Manages client side native call lifecycle.
This constructor should only be used for testing.
Blocking unary request - unary response call.
Starts a unary request - unary response call.
Starts a streamed request - unary response call.
Use StartSendMessage and StartSendCloseFromClient to stream requests.
Starts a unary request - streamed response call.
Starts a streaming request - streaming response call.
Use StartSendMessage and StartSendCloseFromClient to stream requests.
Sends a streaming request. Only one pending send action is allowed at any given time.
Receives a streaming response. Only one pending read action is allowed at any given time.
Sends halfclose, indicating client is done with streaming requests.
Only one pending send action is allowed at any given time.
Get the task that completes once if streaming response call finishes with ok status and throws RpcException with given status otherwise.
Get the task that completes once response headers are received.
Gets the resulting status if the call has already finished.
Throws InvalidOperationException otherwise.
Gets the trailing metadata if the call has already finished.
Throws InvalidOperationException otherwise.
Gets WriteFlags set in callDetails.Options.WriteOptions
Handles receive status completion for calls with streaming response.
Handler for unary response completion.
Handles receive status completion for calls with streaming response.
Base for handling both client side and server side calls.
Manages native call lifecycle and provides convenience methods.
Requests cancelling the call.
Requests cancelling the call with given status.
Initiates sending a message. Only one send operation can be active at a time.
Initiates reading a message. Only one read operation can be active at a time.
If there are no more pending actions and no new actions can be started, releases
the underlying native resources.
Returns an exception to throw for a failed send operation.
It is only allowed to call this method for a call that has already finished.
Checks if sending is allowed and possibly returns a Task that allows short-circuiting the send
logic by directly returning the write operation result task. Normally, null is returned.
Handles send completion (including SendCloseFromClient).
Handles send status from server completion.
Handles streaming read completion.
Manages server side native call lifecycle.
Only for testing purposes.
Starts a server side call.
Sends a streaming response. Only one pending send action is allowed at any given time.
Receives a streaming request. Only one pending read action is allowed at any given time.
Initiates sending a initial metadata.
Even though C-core allows sending metadata in parallel to sending messages, we will treat sending metadata as a send message operation
to make things simpler.
Sends call result status, indicating we are done with writes.
Sending a status different from StatusCode.OK will also implicitly cancel the call.
Gets cancellation token that gets cancelled once close completion
is received and the cancelled flag is set.
Handles the server side close completion.
grpc_auth_context
Copies contents of the native auth context into a new AuthContext instance.
grpc_auth_property
grpc_auth_property_iterator
grpcsharp_batch_context
grpc_call_credentials from grpc/grpc_security.h
grpc_call_error from grpc/grpc.h
Checks the call API invocation's result is OK.
Returns a new instance of with
all previously unset values set to their defaults and deadline and cancellation
token propagated when appropriate.
grpc_call from grpc/grpc.h
Only for testing.
grpc_channel_args from grpc/grpc.h
grpc_channel_credentials from grpc/grpc_security.h
grpc_channel from grpc/grpc.h
Writes requests asynchronously to an underlying AsyncCall object.
Status + metadata received on client side when call finishes.
(when receive_status_on_client operation finishes).
gpr_clock_type from grpc/support/time.h
grpc_event from grpc/grpc.h
grpc_completion_type from grpc/grpc.h
grpc_completion_queue from grpc/grpc.h
Create a completion queue that can only be used for Pluck operations.
Create a completion queue that can only be used for Next operations.
Creates a new usage scope for this completion queue. Once successfully created,
the completion queue won't be shutdown before scope.Dispose() is called.
Completion registry associated with this completion queue.
Doesn't need to be set if only using Pluck() operations.
For testing purposes only. NOT threadsafe.
IntPtr doesn't implement IEquatable{IntPtr} so we need to use custom comparer to avoid boxing.
Context propagation flags from grpc/grpc.h.
Implementation of ContextPropagationToken that carries
all fields needed for context propagation by C-core based implementation of gRPC.
Instances of ContextPropagationToken that are not of this
type will be recognized as "foreign" and will be silently ignored
(treated as if null).
Default propagation mask used by C core.
Default propagation mask used by C# - we want to propagate deadline
and cancellation token by our own means, everything else will be propagated
by C core automatically (according to DefaultCoreMask).
Gets the native handle of the parent call.
Gets the parent call's deadline.
Gets the parent call's cancellation token.
Get the context propagation options.
Converts given ContextPropagationToken to ContextPropagationTokenImpl
if possible or returns null.
Being able to convert means that the context propagation token is recognized as
"ours" (was created by this implementation).
Owned char* object.
Checks the debug stats and take action for any inconsistency found.
Creates native call credential objects from instances of CallCredentials.
Creates native object for the credentials.
The native credentials.
Pool of objects that combines a shared pool and a thread local pool.
Initializes a new instance of DefaultObjectPool with given shared capacity and thread local capacity.
Thread local capacity should be significantly smaller than the shared capacity as we don't guarantee immediately
disposing the objects in the thread local pool after this pool is disposed (they will eventually be garbage collected
after the thread that owns them has finished).
On average, the shared pool will only be accessed approx. once for every threadLocalCapacity / 2 rent or lease
operations.
Leases an item from the pool or creates a new instance if the pool is empty.
Attempts to retrieve the item from the thread local pool first.
If the thread local pool is empty, the item is taken from the shared pool
along with more items that are moved to the thread local pool to avoid
prevent acquiring the lock for shared pool too often.
The methods should not be called after the pool is disposed, but it won't
results in an error to do so (after depleting the items potentially left
in the thread local pool, it will continue returning new objects created by the factory).
Returns an item to the pool.
Attempts to add the item to the thread local pool first.
If the thread local pool is full, item is added to a shared pool,
along with half of the items for the thread local pool, which
should prevent acquiring the lock for shared pool too often.
If called after the pool is disposed, we make best effort not to
add anything to the thread local pool and we guarantee not to add
anything to the shared pool (items will be disposed instead).
Overrides the content of default SSL roots.
Overrides C core's default roots with roots.pem loaded as embedded resource.
Pool of threads polling on a set of completions queues.
Creates a thread pool threads polling on a set of completions queues.
Environment.
Pool size.
Completion queue count.
Handler inlining.
Returns true if there is at least one thread pool thread that hasn't
already stopped.
Threads can either stop because all completion queues shut down or
because all foreground threads have already shutdown and process is
going to exit.
Body of the polling thread.
Abstraction of a native call object.
Pool of objects.
An object that can be pooled in IObjectPool.
Set the action that will be invoked to return a leased object to the pool.
Exposes non-generic members of ServerReponseStream.
Asynchronously sends response headers for the current call to the client. See ServerCallContext.WriteResponseHeadersAsync for exact semantics.
Gets or sets the write options.
Useful methods for native/managed marshalling.
Converts IntPtr pointing to a UTF-8 encoded byte array to string.
Returns byte array containing UTF-8 encoding of given string.
Get string from a UTF8 encoded byte array.
grpc_metadata_array from grpc/grpc.h
Reads metadata from pointer to grpc_metadata_array
Use this attribute to mark methods that will be called back from P/Invoke calls.
iOS (and probably other AOT platforms) needs to have delegates registered.
Instead of depending on Xamarin.iOS for this, we can just create our own,
the iOS runtime just checks for the type name.
See: https://docs.microsoft.com/en-gb/xamarin/ios/internals/limitations#reverse-callbacks
Takes care of loading C# native extension and provides access to PInvoke calls the library exports.
Gets singleton instance of this class.
The native extension is loaded when called for the first time.
Provides access to the exported native methods.
Detects which configuration of native extension to load and load it.
Loads native extension and return native methods delegates.
Return native method delegates when running on Unity platform.
Unity does not use standard NuGet packages and the native library is treated
there as a "native plugin" which is (provided it has the right metadata)
automatically made available to [DllImport] loading logic.
WARNING: Unity support is experimental and work-in-progress. Don't expect it to work.
Return native method delegates when running on the Xamarin platform.
WARNING: Xamarin support is experimental and work-in-progress. Don't expect it to work.
Logs from gRPC C core library can get lost if your application is not a console app.
This class allows redirection of logs to gRPC logger.
Redirects logs from native gRPC C core library to a general logger.
Provides access to all native methods provided by NativeExtension.
An extra level of indirection is added to P/Invoke calls to allow intelligent loading
of the right configuration of the native extension based on current platform, architecture etc.
Gets singleton instance of this class.
Delegate types for all published native methods. Declared under inner class to prevent scope pollution.
grpc_csharp_ext used as a static library (e.g Unity iOS).
grpc_csharp_ext used a shared library (e.g on Unity Standalone and Android).
Utility methods for detecting platform and architecture.
true if running on Unity platform.
true if running on Unity iOS, false otherwise.
true if running on a Xamarin platform (either Xamarin.Android or Xamarin.iOS),
false otherwise.
true if running on Xamarin.iOS, false otherwise.
true if running on Xamarin.Android, false otherwise.
true if running on .NET Core (CoreCLR), false otherwise.
Returns UnityEngine.Application.platform as a string.
See https://docs.unity3d.com/ScriptReference/Application-platform.html for possible values.
Value is obtained via reflection to avoid compile-time dependency on Unity.
This method should only be called if IsUnity is true.
grpcsharp_request_call_context
Safe handle to wrap native objects.
Handler used for unimplemented method.
grpc_server_credentials from grpc/grpc_security.h
Writes responses asynchronously to an underlying AsyncCallServer object.
Details of a newly received RPC.
grpc_server from grpc/grpc.h
Maps methods from ServerServiceDefinition to server call handlers.
Helper for converting ServerServiceDefinition to server call handlers.
Slice of native memory.
Rough equivalent of grpc_slice (but doesn't support inlined slices, just a pointer to data and length)
Returns a that represents the current .
gpr_timespec from grpc/support/time.h
Timespec a long time in the future.
Timespec a long time in the past.
Return Timespec representing the current time.
Seconds since unix epoch.
The nanoseconds part of timeval.
Converts the timespec to desired clock type.
Converts Timespec to DateTime.
Timespec needs to be of type GPRClockType.Realtime and needs to represent a legal value.
DateTime has lower resolution (100ns), so rounding can occurs.
Value are always rounded up to the nearest DateTime value in the future.
For Timespec.InfFuture or if timespec is after the largest representable DateTime, DateTime.MaxValue is returned.
For Timespec.InfPast or if timespec is before the lowest representable DateTime, DateTime.MinValue is returned.
Unless DateTime.MaxValue or DateTime.MinValue is returned, the resulting DateTime is always in UTC
(DateTimeKind.Utc)
Creates DateTime to Timespec.
DateTime has to be in UTC (DateTimeKind.Utc) unless it's DateTime.MaxValue or DateTime.MinValue.
For DateTime.MaxValue of date time after the largest representable Timespec, Timespec.InfFuture is returned.
For DateTime.MinValue of date time before the lowest representable Timespec, Timespec.InfPast is returned.
The date time.
Date time.
Gets current timestamp using GPRClockType.Precise.
Only available internally because core needs to be compiled with
GRPC_TIMERS_RDTSC support for this to use RDTSC.
Call invoker that throws NotImplementedException for all requests.
Represents a dynamically loaded unmanaged library in a (partially) platform independent manner.
First, the native library is loaded using dlopen (on Unix systems) or using LoadLibrary (on Windows).
dlsym or GetProcAddress are then used to obtain symbol addresses. Marshal.GetDelegateForFunctionPointer
transforms the addresses into delegates to native methods.
See http://stackoverflow.com/questions/13461989/p-invoke-to-dynamically-loaded-library-on-mono.
Loads symbol in a platform specific way.
Loads library in a platform specific way.
On Linux systems, using using dlopen and dlsym results in
DllNotFoundException("libdl.so not found") if libc6-dev
is not installed. As a workaround, we load symbols for
dlopen and dlsym from the current process as on Linux
Mono sure is linked against these symbols.
Similarly as for Mono on Linux, we load symbols for
dlopen and dlsym from the "libcoreclr.so",
to avoid the dependency on libc-dev Linux.
Default implementation of ServerCallContext.
Creates a new instance of ServerCallContext.
To allow reuse of ServerCallContext API by different gRPC implementations, the implementation of some members is provided externally.
To provide state, this ServerCallContext instance and extraData will be passed to the member implementations.
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.
Logger that logs to System.Console.
Creates a console logger not associated to any specific type.
Creates a console logger that logs messsage specific for given type.
Returns a logger associated with the specified type.
For logging messages.
Returns a logger associated with the specified type.
Logs a message with severity Debug.
Logs a formatted message with severity Debug.
Logs a message with severity Info.
Logs a formatted message with severity Info.
Logs a message with severity Warning.
Logs a formatted message with severity Warning.
Logs a message and an associated exception with severity Warning.
Logs a message with severity Error.
Logs a formatted message with severity Error.
Logs a message and an associated exception with severity Error.
Standard logging levels.
Debug severity.
Info severity.
Warning severity.
Error severity.
Logging is off.
Logger that filters out messages below certain log level.
Creates and instance of LogLevelFilter.
Creates and instance of LogLevelFilter.
The fromEnvironmentVariable parameter allows looking up "GRPC_VERBOSITY" setting provided by C-core
and uses the same log level for C# logs. Using this setting is recommended as it can prevent unintentionally hiding
C core logs requested by "GRPC_VERBOSITY" environment variable (which could happen if C# logger's log level was set to a more restrictive value).
the logger to forward filtered logs to.
the default log level, unless overriden by env variable.
if true, override log level with setting from environment variable.
Returns a logger associated with the specified type.
Logs a message with severity Debug.
Logs a formatted message with severity Debug.
Logs a message with severity Info.
Logs a formatted message with severity Info.
Logs a message with severity Warning.
Logs a formatted message with severity Warning.
Logs a message and an associated exception with severity Warning.
Logs a message with severity Error.
Logs a formatted message with severity Error.
Logs a message and an associated exception with severity Error.
Get log level based on a default and lookup of GRPC_VERBOSITY environment variable.
Logger which doesn't log any information anywhere.
As with all logging calls on this logger, this method is a no-op.
As with all logging calls on this logger, this method is a no-op.
As with all logging calls on this logger, this method is a no-op.
As with all logging calls on this logger, this method is a no-op.
As with all logging calls on this logger, this method is a no-op.
Returns a reference to the instance on which the method is called, as
instances aren't associated with specific types.
As with all logging calls on this logger, this method is a no-op.
As with all logging calls on this logger, this method is a no-op.
As with all logging calls on this logger, this method is a no-op.
As with all logging calls on this logger, this method is a no-op.
As with all logging calls on this logger, this method is a no-op.
Logger that logs to an arbitrary System.IO.TextWriter.
Creates a console logger not associated to any specific type and writes to given System.IO.TextWriter.
User is responsible for providing an instance of TextWriter that is thread-safe.
Creates a console logger not associated to any specific type and writes to a System.IO.TextWriter obtained from given provider.
User is responsible for providing an instance of TextWriter that is thread-safe.
Creates a console logger that logs messsage specific for given type.
Returns a logger associated with the specified type.
Logs a message with severity Debug.
Logs a formatted message with severity Debug.
Logs a message with severity Info.
Logs a formatted message with severity Info.
Logs a message with severity Warning.
Logs a formatted message with severity Warning.
Logs a message and an associated exception with severity Warning.
Logs a message with severity Error.
Logs a formatted message with severity Error.
Logs a message and an associated exception with severity Error.
Gets the type associated with this logger.
gRPC server. A single server can serve an arbitrary number of services and can listen on more than one port.
Creates a new server.
Creates a new server.
Channel options.
Services that will be exported by the server once started. Register a service with this
server by adding its definition to this collection.
Ports on which the server will listen once started. Register a port with this
server by adding its definition to this collection.
To allow awaiting termination of the server.
Experimental API. Might anytime change without prior notice.
Number or calls requested via grpc_server_request_call at any given time for each completion queue.
Starts the server.
Throws IOException if not successful.
Requests server shutdown and when there are no more calls being serviced,
cleans up used resources. The returned task finishes when shutdown procedure
is complete.
It is strongly recommended to shutdown all previously created servers before exiting from the process.
Requests server shutdown while cancelling all the in-progress calls.
The returned task finishes when shutdown procedure is complete.
It is strongly recommended to shutdown all previously created servers before exiting from the process.
Shuts down the server.
In case the environment's threadpool becomes dead, the shutdown completion will
never be delivered, but we need to release the environment's handle anyway.
Adds a service definition.
Adds a listening port.
Allows one new RPC call to be received by server.
Checks that all ports have been bound successfully.
Selects corresponding handler for given call and handles the call.
Handles the native callback.
Handles native callback.
Collection of service definitions.
Adds a service definition to the server. This is how you register
handlers for a service with the server. Only call this before Start().
Gets enumerator for this collection.
Collection of server ports.
Adds a new port on which server should listen.
Only call this before Start().
The port on which server will be listening.
Adds a new port on which server should listen.
The port on which server will be listening.
the host
the port. If zero, an unused port is chosen automatically.
credentials to use to secure this port.
Gets enumerator for this collection.
Server side credentials.
Returns instance of credential that provides no security and
will result in creating an unsecure server port with no encryption whatsoever.
Creates native object for the credentials.
The native credentials.
Modes of requesting client's SSL certificate by the server.
Corresponds to grpc_ssl_client_certificate_request_type.
Server does not request client certificate.
The certificate presented by the client is not checked by the server at
all. (A client may present a self signed or signed certificate or not
present a certificate at all and any of those option would be accepted)
Server requests client certificate but does not enforce that the client
presents a certificate.
If the client presents a certificate, the client authentication is left to
the application (the necessary metadata will be available to the
application via authentication context properties, see grpc_auth_context).
The client's key certificate pair must be valid for the SSL connection to
be established.
Server requests client certificate but does not enforce that the client
presents a certificate.
If the client presents a certificate, the client authentication is done by
the gRPC framework. (For a successful connection the client needs to either
present a certificate that can be verified against the root certificate
configured by the server or not present a certificate at all)
The client's key certificate pair must be valid for the SSL connection to
be established.
Server requests client certificate and enforces that the client presents a
certificate.
If the client presents a certificate, the client authentication is left to
the application (the necessary metadata will be available to the
application via authentication context properties, see grpc_auth_context).
The client's key certificate pair must be valid for the SSL connection to
be established.
Server requests client certificate and enforces that the client presents a
certificate.
The cerificate presented by the client is verified by the gRPC framework.
(For a successful connection the client needs to present a certificate that
can be verified against the root certificate configured by the server)
The client's key certificate pair must be valid for the SSL connection to
be established.
Server-side SSL credentials.
Creates server-side SSL credentials.
Key-certificates to use.
PEM encoded client root certificates used to authenticate client.
Deprecated, use clientCertificateRequest overload instead.
Creates server-side SSL credentials.
Key-certificates to use.
PEM encoded client root certificates used to authenticate client.
Options for requesting and verifying client certificate.
Creates server-side SSL credentials.
This constructor should be used if you do not wish to authenticate the client.
(client certificate won't be requested and checked by the server at all).
Key-certificates to use.
Key-certificate pairs.
PEM encoded client root certificates.
Deprecated. If true, the authenticity of client check will be enforced.
Mode of requesting certificate from client by the server.
A port exposed by a server.
Pass this value as port to have the server choose an unused listening port for you.
Ports added to a server will contain the bound port in their property.
Creates a new port on which server should listen.
The port on which server will be listening.
the host
the port. If zero, an unused port is chosen automatically.
credentials to use to secure this port.
Creates a port from an existing ServerPort instance and boundPort value.
The host.
The port.
The server credentials.
The port actually bound by the server. This is useful if you let server
pick port automatically.
Extension methods that simplify work with gRPC streaming calls.
Reads the entire stream and executes an async action for each element.
Reads the entire stream and creates a list containing all the elements read.
Writes all elements from given enumerable to the stream.
Completes the stream afterwards unless close = false.
Writes all elements from given enumerable to the stream.
Utility methods to run microbenchmarks.
Runs a simple benchmark preceded by warmup phase.
Utility methods for task parallel library.
Framework independent equivalent of Task.CompletedTask.
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.