# Class ServerCallContext (2.66.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.66.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext)
- [2.63.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Core.ServerCallContext)
- [2.48.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Core.ServerCallContext)

    public abstract class ServerCallContext

Context for a server-side call.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> ServerCallContext

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Grpc.Core](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core)

## Assembly

Grpc.Core.Api.dll

## Constructors

### ServerCallContext()

    protected ServerCallContext()

Creates a new instance of `ServerCallContext`.

## Properties

### AuthContext

    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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AuthContext` |   |

### AuthContextCore

    protected abstract AuthContext AuthContextCore { get; }

Provides implementation of a non-virtual public member.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AuthContext` |   |

### CancellationToken

    public CancellationToken CancellationToken { get; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` |   |

### CancellationTokenCore

    protected abstract CancellationToken CancellationTokenCore { get; }

Provides implementation of a non-virtual public member.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` |   |

### Deadline

    public DateTime Deadline { get; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.datetime` |   |

### DeadlineCore

    protected abstract DateTime DeadlineCore { get; }

Provides implementation of a non-virtual public member.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.datetime` |   |

### Host

    public string Host { get; }

Name of host called in this RPC.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### HostCore

    protected abstract string HostCore { get; }

Provides implementation of a non-virtual public member.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Method

    public string Method { get; }

Name of method called in this RPC.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### MethodCore

    protected abstract string MethodCore { get; }

Provides implementation of a non-virtual public member.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Peer

    public string Peer { get; }

Address of the remote endpoint in URI format.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### PeerCore

    protected abstract string PeerCore { get; }

Provides implementation of a non-virtual public member.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### RequestHeaders

    public Metadata RequestHeaders { get; }

Initial metadata sent by client.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata` |   |

### RequestHeadersCore

    protected abstract Metadata RequestHeadersCore { get; }

Provides implementation of a non-virtual public member.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata` |   |

### ResponseTrailers

    public Metadata ResponseTrailers { get; }

Trailers to send back to client after RPC finishes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata` |   |

### ResponseTrailersCore

    protected abstract Metadata ResponseTrailersCore { get; }

Provides implementation of a non-virtual public member.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata` |   |

### Status

    public Status Status { get; set; }

Status to send back to client after RPC finishes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Status` |   |

### StatusCore

    protected abstract Status StatusCore { get; set; }

Provides implementation of a non-virtual public member.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Status` |   |

### UserState

    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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.idictionary-2https://learn.microsoft.com/dotnet/api/system.objecthttps://learn.microsoft.com/dotnet/api/system.object` |   |

### UserStateCore

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

Provides implementation of a non-virtual public member.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.idictionary-2https://learn.microsoft.com/dotnet/api/system.objecthttps://learn.microsoft.com/dotnet/api/system.object` |   |

### WriteOptions

    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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.WriteOptions` |   |

### WriteOptionsCore

    protected abstract WriteOptions? WriteOptionsCore { get; set; }

Provides implementation of a non-virtual public member.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.WriteOptions` |   |

## Methods

### CreatePropagationToken(ContextPropagationOptions?)

    public ContextPropagationToken CreatePropagationToken(ContextPropagationOptions? options = null)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ContextPropagationOptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ContextPropagationToken` |   |

### CreatePropagationTokenCore(ContextPropagationOptions?)

    protected abstract ContextPropagationToken CreatePropagationTokenCore(ContextPropagationOptions? options)

Provides implementation of a non-virtual public member.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ContextPropagationOptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ContextPropagationToken` |   |

### WriteResponseHeadersAsync(Metadata)

    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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `responseHeaders` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata` The response headers to send. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | The task that finished once response headers have been written. |

### WriteResponseHeadersAsyncCore(Metadata)

    protected abstract Task WriteResponseHeadersAsyncCore(Metadata responseHeaders)

Provides implementation of a non-virtual public member.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `responseHeaders` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` |   |