Show / Hide Table of Contents

Class ChannelBase

Base class for gRPC channel. Channels are an abstraction of long-lived connections to remote servers.

Inheritance
System.Object
ChannelBase
Channel
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Grpc.Core
Assembly: Grpc.Core.Api.dll
Syntax
public abstract class ChannelBase

Constructors

ChannelBase(String)

Initializes a new instance of ChannelBase class that connects to a specific host.

Declaration
protected ChannelBase(string target)
Parameters
Type Name Description
System.String target

Target of the channel.

Properties

Target

The original target used to create the channel.

Declaration
public string Target { get; }
Property Value
Type Description
System.String

Methods

CreateCallInvoker()

Create a new CallInvoker for the channel.

Declaration
public abstract CallInvoker CreateCallInvoker()
Returns
Type Description
CallInvoker

A new CallInvoker.

ShutdownAsync()

Shuts down the channel cleanly. It is strongly recommended to shutdown the channel once you stopped using it.

Declaration
public Task ShutdownAsync()
Returns
Type Description
System.Threading.Tasks.Task
Remarks

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.

ShutdownAsyncCore()

Provides implementation of a non-virtual public member.

Declaration
protected virtual Task ShutdownAsyncCore()
Returns
Type Description
System.Threading.Tasks.Task

Extension Methods

ChannelExtensions.Intercept(ChannelBase, Interceptor)
ChannelExtensions.Intercept(ChannelBase, Interceptor[])
ChannelExtensions.Intercept(ChannelBase, Func<Metadata, Metadata>)
Back to top