<PackageReference Include="Grpc.Core.Api" Version="2.76.0-pre1" />

Grpc.Core.ServerCallContext

public abstract class ServerCallContext
Context for a server-side call.
public AuthContext AuthContext { get; }

Gets the AuthContext associated with this call. Note: Access to AuthContext is an experimental API that can change without any prior notice.

protected abstract AuthContext AuthContextCore { get; }

Provides implementation of a non-virtual public member.

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).

protected abstract CancellationToken CancellationTokenCore { get; }

Provides implementation of a non-virtual public member.

public DateTime Deadline { get; }

Deadline for this RPC. The call will be automatically cancelled once the deadline is exceeded.

protected abstract DateTime DeadlineCore { get; }

Provides implementation of a non-virtual public member.

public string Host { get; }

Name of host called in this RPC.

protected abstract string HostCore { get; }

Provides implementation of a non-virtual public member.

public string Method { get; }

Name of method called in this RPC.

protected abstract string MethodCore { get; }

Provides implementation of a non-virtual public member.

public string Peer { get; }

Address of the remote endpoint in URI format.

protected abstract string PeerCore { get; }

Provides implementation of a non-virtual public member.

public Metadata RequestHeaders { get; }

Initial metadata sent by client.

protected abstract Metadata RequestHeadersCore { get; }

Provides implementation of a non-virtual public member.

public Metadata ResponseTrailers { get; }

Trailers to send back to client after RPC finishes.

protected abstract Metadata ResponseTrailersCore { get; }

Provides implementation of a non-virtual public member.

public Status Status { get; set; }

Status to send back to client after RPC finishes.

protected abstract Status StatusCore { get; protected set; }

Provides implementation of a non-virtual public member.

public IDictionary<object, object> UserState { get; }

Gets a dictionary that can be used by the various interceptors and handlers of this call to store arbitrary state.

protected virtual IDictionary<object, object> UserStateCore { get; }

Provides implementation of a non-virtual public member.

public WriteOptions WriteOptions { get; set; }

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.

protected abstract WriteOptions WriteOptionsCore { get; protected set; }

Provides implementation of a non-virtual public member.

protected ServerCallContext()

Creates a new instance of ServerCallContext.

Creates a propagation token to be used to propagate call context to a child call.

Provides implementation of a non-virtual public member.

public Task WriteResponseHeadersAsync(Metadata responseHeaders)

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.

protected abstract Task WriteResponseHeadersAsyncCore(Metadata responseHeaders)

Provides implementation of a non-virtual public member.