Class ServerCallContext
Context for a server-side call.
Inheritance
Namespace: Grpc.Core
Assembly: Grpc.Core.Api.dll
Syntax
public abstract class ServerCallContext : object
Constructors
ServerCallContext()
Creates a new instance of ServerCallContext
.
Declaration
protected ServerCallContext()
Properties
AuthContext
Gets the AuthContext
associated with this call.
Note: Access to AuthContext is an experimental API that can change without any prior notice.
Declaration
public AuthContext AuthContext { get; }
Property Value
Type | Description |
---|---|
AuthContext |
AuthContextCore
Provides implementation of a non-virtual public member.
Declaration
protected abstract AuthContext AuthContextCore { get; }
Property Value
Type | Description |
---|---|
AuthContext |
CancellationToken
Cancellation token signals when call is cancelled.
Declaration
public CancellationToken CancellationToken { get; }
Property Value
Type | Description |
---|---|
CancellationToken |
CancellationTokenCore
Provides implementation of a non-virtual public member.
Declaration
protected abstract CancellationToken CancellationTokenCore { get; }
Property Value
Type | Description |
---|---|
CancellationToken |
Deadline
Deadline for this RPC.
Declaration
public DateTime Deadline { get; }
Property Value
Type | Description |
---|---|
DateTime |
DeadlineCore
Provides implementation of a non-virtual public member.
Declaration
protected abstract DateTime DeadlineCore { get; }
Property Value
Type | Description |
---|---|
DateTime |
Host
Name of host called in this RPC.
Declaration
public string Host { get; }
Property Value
Type | Description |
---|---|
System.String |
HostCore
Provides implementation of a non-virtual public member.
Declaration
protected abstract string HostCore { get; }
Property Value
Type | Description |
---|---|
System.String |
Method
Name of method called in this RPC.
Declaration
public string Method { get; }
Property Value
Type | Description |
---|---|
System.String |
MethodCore
Provides implementation of a non-virtual public member.
Declaration
protected abstract string MethodCore { get; }
Property Value
Type | Description |
---|---|
System.String |
Peer
Address of the remote endpoint in URI format.
Declaration
public string Peer { get; }
Property Value
Type | Description |
---|---|
System.String |
PeerCore
Provides implementation of a non-virtual public member.
Declaration
protected abstract string PeerCore { get; }
Property Value
Type | Description |
---|---|
System.String |
RequestHeaders
Initial metadata sent by client.
Declaration
public Metadata RequestHeaders { get; }
Property Value
Type | Description |
---|---|
Metadata |
RequestHeadersCore
Provides implementation of a non-virtual public member.
Declaration
protected abstract Metadata RequestHeadersCore { get; }
Property Value
Type | Description |
---|---|
Metadata |
ResponseTrailers
Trailers to send back to client after RPC finishes.
Declaration
public Metadata ResponseTrailers { get; }
Property Value
Type | Description |
---|---|
Metadata |
ResponseTrailersCore
Provides implementation of a non-virtual public member.
Declaration
protected abstract Metadata ResponseTrailersCore { get; }
Property Value
Type | Description |
---|---|
Metadata |
Status
Status to send back to client after RPC finishes.
Declaration
public Status Status { get; set; }
Property Value
Type | Description |
---|---|
Status |
StatusCore
Provides implementation of a non-virtual public member.
Declaration
protected abstract Status StatusCore { get; set; }
Property Value
Type | Description |
---|---|
Status |
UserState
Gets a dictionary that can be used by the various interceptors and handlers of this call to store arbitrary state.
Declaration
public IDictionary<object, object> UserState { get; }
Property Value
Type | Description |
---|---|
IDictionary<System.Object, System.Object> |
UserStateCore
Provides implementation of a non-virtual public member.
Declaration
protected virtual IDictionary<object, object> UserStateCore { get; }
Property Value
Type | Description |
---|---|
IDictionary<System.Object, System.Object> |
WriteOptions
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.
Declaration
public WriteOptions WriteOptions { get; set; }
Property Value
Type | Description |
---|---|
WriteOptions |
WriteOptionsCore
Provides implementation of a non-virtual public member.
Declaration
protected abstract WriteOptions WriteOptionsCore { get; set; }
Property Value
Type | Description |
---|---|
WriteOptions |
Methods
CreatePropagationToken(ContextPropagationOptions)
Creates a propagation token to be used to propagate call context to a child call.
Declaration
public ContextPropagationToken CreatePropagationToken(ContextPropagationOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
ContextPropagationOptions | options |
Returns
Type | Description |
---|---|
ContextPropagationToken |
CreatePropagationTokenCore(ContextPropagationOptions)
Provides implementation of a non-virtual public member.
Declaration
protected abstract ContextPropagationToken CreatePropagationTokenCore(ContextPropagationOptions options)
Parameters
Type | Name | Description |
---|---|---|
ContextPropagationOptions | options |
Returns
Type | Description |
---|---|
ContextPropagationToken |
WriteResponseHeadersAsync(Metadata)
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.
Declaration
public Task WriteResponseHeadersAsync(Metadata responseHeaders)
Parameters
Type | Name | Description |
---|---|---|
Metadata | responseHeaders | The response headers to send. |
Returns
Type | Description |
---|---|
Task | The task that finished once response headers have been written. |
WriteResponseHeadersAsyncCore(Metadata)
Provides implementation of a non-virtual public member.
Declaration
protected abstract Task WriteResponseHeadersAsyncCore(Metadata responseHeaders)
Parameters
Type | Name | Description |
---|---|---|
Metadata | responseHeaders |
Returns
Type | Description |
---|---|
Task |