Class GrpcChannelOptions (4.4.0)

public sealed class GrpcChannelOptions : IEquatable<GrpcChannelOptions>

Portable abstraction of channel options

Inheritance

object > GrpcChannelOptions

Namespace

Google.Api.Gax.Grpc

Assembly

Google.Api.Gax.Grpc.dll

Properties

CustomOptions

public IReadOnlyList<GrpcChannelOptions.CustomOption> CustomOptions { get; }

Immutable list of custom options. This is never null, but may be empty.

Property Value
TypeDescription
IReadOnlyListGrpcChannelOptionsCustomOption

Empty

public static GrpcChannelOptions Empty { get; }

An empty set of channel options.

Property Value
TypeDescription
GrpcChannelOptions

EnableServiceConfigResolution

public bool? EnableServiceConfigResolution { get; }

If non-null, explicitly enables or disables service configuration resolution.

Property Value
TypeDescription
bool

KeepAliveTime

public TimeSpan? KeepAliveTime { get; }

If non-null, explicitly specifies the keep-alive period for the channel. This specifies how often a keep-alive request is sent.

Property Value
TypeDescription
TimeSpan

KeepAliveTimeout

public TimeSpan? KeepAliveTimeout { get; }

If non-null, explicitly specifies the keep-alive timeout for the channel. This specifies how long gRPC will wait for a keep-alive response before assuming the channel is no longer valid, and closing it.

Property Value
TypeDescription
TimeSpan

MaxReceiveMessageSize

public int? MaxReceiveMessageSize { get; }

If non-null, explicitly specifies the maximum size in bytes that can be received from the client, per response.

Property Value
TypeDescription
int

MaxSendMessageSize

public int? MaxSendMessageSize { get; }

If non-null, explicitly specifies the maximum size in bytes that can be sent from the client, per request.

Property Value
TypeDescription
int

PrimaryUserAgent

public string PrimaryUserAgent { get; }

If non-null, explicitly specifies the primary user agent for the channel.

Property Value
TypeDescription
string

Methods

Equals(GrpcChannelOptions)

public bool Equals(GrpcChannelOptions other)
Parameter
NameDescription
otherGrpcChannelOptions
Returns
TypeDescription
bool

Equals(object)

public override bool Equals(object obj)
Parameter
NameDescription
objobject
Returns
TypeDescription
bool
Overrides

GetHashCode()

public override int GetHashCode()
Returns
TypeDescription
int
Overrides

MergedWith(GrpcChannelOptions)

public GrpcChannelOptions MergedWith(GrpcChannelOptions overlaidOptions)

Returns a new object, with options from this object merged with overlaidOptions. If an option is non-null in both objects, the one from overlaidOptions takes priority.

Parameter
NameDescription
overlaidOptionsGrpcChannelOptions

The overlaid options. Must not be null.

Returns
TypeDescription
GrpcChannelOptions

The new merged options.

WithCustomOption(CustomOption)

public GrpcChannelOptions WithCustomOption(GrpcChannelOptions.CustomOption option)

Returns a new instance with the same options as this one, but with a new integer-valued GrpcChannelOptions.CustomOption at the end of CustomOptions.

Parameter
NameDescription
optionGrpcChannelOptionsCustomOption

The additional custom option to include. Must not be null.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithCustomOption(string, int)

public GrpcChannelOptions WithCustomOption(string name, int value)

Returns a new instance with the same options as this one, but with a new integer-valued GrpcChannelOptions.CustomOption at the end of CustomOptions.

Parameters
NameDescription
namestring

The name of the new custom option. Must not be null.

valueint

The value of the new custom option.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithCustomOption(string, string)

public GrpcChannelOptions WithCustomOption(string name, string value)

Returns a new instance with the same options as this one, but with a new string-valued GrpcChannelOptions.CustomOption at the end of CustomOptions.

Parameters
NameDescription
namestring

The name of the new custom option. Must not be null.

valuestring

The value of the new custom option. Must not be null.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithEnableServiceConfigResolution(bool)

public GrpcChannelOptions WithEnableServiceConfigResolution(bool enableServiceConfigResolution)

Returns a new instance with the same options as this one, but with EnableServiceConfigResolution set to enableServiceConfigResolution.

Parameter
NameDescription
enableServiceConfigResolutionbool

The new option for enabling service config resolution.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithKeepAliveTime(TimeSpan)

public GrpcChannelOptions WithKeepAliveTime(TimeSpan keepAliveTime)

Returns a new instance with the same options as this one, but with KeepAliveTime set to keepAliveTime.

Parameter
NameDescription
keepAliveTimeTimeSpan

The new keep-alive time.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithKeepAliveTimeout(TimeSpan)

public GrpcChannelOptions WithKeepAliveTimeout(TimeSpan keepAliveTimeout)

Returns a new instance with the same options as this one, but with KeepAliveTimeout set to keepAliveTimeout.

Parameter
NameDescription
keepAliveTimeoutTimeSpan

The new keep-alive timeout.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithMaxReceiveMessageSize(int)

public GrpcChannelOptions WithMaxReceiveMessageSize(int maxReceiveMessageSize)

Returns a new instance with the same options as this one, but with MaxReceiveMessageSize set to maxReceiveMessageSize.

Parameter
NameDescription
maxReceiveMessageSizeint

The new maximum receive message size, in bytes.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithMaxSendMessageSize(int)

public GrpcChannelOptions WithMaxSendMessageSize(int maxSendMessageSize)

Returns a new instance with the same options as this one, but with MaxSendMessageSize set to maxSendMessageSize.

Parameter
NameDescription
maxSendMessageSizeint

The new maximum send message size, in bytes.

Returns
TypeDescription
GrpcChannelOptions

The new options.

WithPrimaryUserAgent(string)

public GrpcChannelOptions WithPrimaryUserAgent(string primaryUserAgent)

Returns a new instance with the same options as this one, but with PrimaryUserAgent set to primaryUserAgent.

Parameter
NameDescription
primaryUserAgentstring

The new primary user agent. Must not be null.

Returns
TypeDescription
GrpcChannelOptions

The new options.