<PackageReference Include="Grpc.Core.Api" Version="2.71.0" />

Grpc.Core.CallOptions

public struct CallOptions
Options for calls made by client.

Token that can be used for cancelling the call on the client side. Cancelling the token will request cancellation of the remote call. Best effort will be made to deliver the cancellation notification to the server and interaction of the call with the server side will be terminated. Unless the call finishes before the cancellation could happen (there is an inherent race), the call will finish with StatusCode.Cancelled status.

public CallCredentials Credentials { get; }

Credentials to use for this call.

public DateTime? Deadline { get; }

Call deadline.

public Metadata Headers { get; }

Headers to send at the beginning of the call.

public bool IsWaitForReady { get; }

If true and channel is in ChannelState.TransientFailure, the call will attempt waiting for the channel to recover instead of failing immediately (which is the default "FailFast" semantics). Note: experimental API that can change or be removed without any prior notice.

Token for propagating parent call context.

public WriteOptions WriteOptions { get; }

Write options that will be used for this call.

public CallOptions(Metadata headers = null, DateTime? deadline = default, CancellationToken cancellationToken = default, WriteOptions writeOptions = null, ContextPropagationToken propagationToken = null, CallCredentials credentials = null)

Creates a new instance of CallOptions struct.

Returns new instance of CallOptions with CancellationToken set to the value provided. Values of all other fields are preserved.

Returns new instance of CallOptions with Credentials set to the value provided. Values of all other fields are preserved.

Returns new instance of CallOptions with Deadline set to the value provided. Values of all other fields are preserved.

Returns new instance of CallOptions with Headers set to the value provided. Values of all other fields are preserved.

Returns new instance of CallOptions with PropagationToken set to the value provided. Values of all other fields are preserved.

public CallOptions WithWaitForReady(bool waitForReady = true)

Returns new instance of CallOptions with "WaitForReady" semantics enabled/disabled. IsWaitForReady. Note: experimental API that can change or be removed without any prior notice.

Returns new instance of CallOptions with WriteOptions set to the value provided. Values of all other fields are preserved.