Class ServerCallContext
Context for a server-side call.
Inheritance
Inherited Members
Namespace: Grpc.Core
Assembly: Grpc.Core.Api.dll
Syntax
public abstract class ServerCallContext
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 |
|---|---|
| System.Threading.CancellationToken |
CancellationTokenCore
Provides implementation of a non-virtual public member.
Declaration
protected abstract CancellationToken CancellationTokenCore { get; }
Property Value
| Type | Description |
|---|---|
| System.Threading.CancellationToken |
Deadline
Deadline for this RPC.
Declaration
public DateTime Deadline { get; }
Property Value
| Type | Description |
|---|---|
| System.DateTime |
DeadlineCore
Provides implementation of a non-virtual public member.
Declaration
protected abstract DateTime DeadlineCore { get; }
Property Value
| Type | Description |
|---|---|
| System.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 |
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 |
|---|---|
| System.Threading.Tasks.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 |
|---|---|
| System.Threading.Tasks.Task |