Show / Hide Table of Contents

Class GrpcChannelOptions

Portable abstraction of channel options

Inheritance
System.Object
GrpcChannelOptions
Implements
System.IEquatable<GrpcChannelOptions>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Api.Gax.Grpc
Assembly: Google.Api.Gax.Grpc.dll
Syntax
public sealed class GrpcChannelOptions : IEquatable<GrpcChannelOptions>

Properties

CustomOptions

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

Declaration
public IReadOnlyList<GrpcChannelOptions.CustomOption> CustomOptions { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyList<GrpcChannelOptions.CustomOption>

Empty

An empty set of channel options.

Declaration
public static GrpcChannelOptions Empty { get; }
Property Value
Type Description
GrpcChannelOptions

EnableServiceConfigResolution

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

Declaration
public bool? EnableServiceConfigResolution { get; }
Property Value
Type Description
System.Nullable<System.Boolean>

KeepAliveTime

If non-null, explicitly specifies the keep-alive period for the channel.

Declaration
public TimeSpan? KeepAliveTime { get; }
Property Value
Type Description
System.Nullable<System.TimeSpan>

MaxReceiveMessageSize

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

Declaration
public int? MaxReceiveMessageSize { get; }
Property Value
Type Description
System.Nullable<System.Int32>

MaxSendMessageSize

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

Declaration
public int? MaxSendMessageSize { get; }
Property Value
Type Description
System.Nullable<System.Int32>

PrimaryUserAgent

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

Declaration
public string PrimaryUserAgent { get; }
Property Value
Type Description
System.String

Methods

Equals(GrpcChannelOptions)

Declaration
public bool Equals(GrpcChannelOptions other)
Parameters
Type Name Description
GrpcChannelOptions other
Returns
Type Description
System.Boolean
Implements
System.IEquatable<T>.Equals(T)

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean
Overrides
System.Object.Equals(System.Object)

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.Object.GetHashCode()

MergedWith(GrpcChannelOptions)

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.

Declaration
public GrpcChannelOptions MergedWith(GrpcChannelOptions overlaidOptions)
Parameters
Type Name Description
GrpcChannelOptions overlaidOptions

The overlaid options. Must not be null.

Returns
Type Description
GrpcChannelOptions

The new merged options.

WithCustomOption(GrpcChannelOptions.CustomOption)

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

Declaration
public GrpcChannelOptions WithCustomOption(GrpcChannelOptions.CustomOption option)
Parameters
Type Name Description
GrpcChannelOptions.CustomOption option

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

Returns
Type Description
GrpcChannelOptions

The new options.

WithCustomOption(String, Int32)

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

Declaration
public GrpcChannelOptions WithCustomOption(string name, int value)
Parameters
Type Name Description
System.String name

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

System.Int32 value

The value of the new custom option.

Returns
Type Description
GrpcChannelOptions

The new options.

WithCustomOption(String, String)

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

Declaration
public GrpcChannelOptions WithCustomOption(string name, string value)
Parameters
Type Name Description
System.String name

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

System.String value

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

Returns
Type Description
GrpcChannelOptions

The new options.

WithEnableServiceConfigResolution(Boolean)

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

Declaration
public GrpcChannelOptions WithEnableServiceConfigResolution(bool enableServiceConfigResolution)
Parameters
Type Name Description
System.Boolean enableServiceConfigResolution

The new option for enabling service config resolution.

Returns
Type Description
GrpcChannelOptions

The new options.

WithKeepAliveTime(TimeSpan)

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

Declaration
public GrpcChannelOptions WithKeepAliveTime(TimeSpan keepAliveTime)
Parameters
Type Name Description
System.TimeSpan keepAliveTime

The new keep-alive time.

Returns
Type Description
GrpcChannelOptions

The new options.

WithMaxReceiveMessageSize(Int32)

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

Declaration
public GrpcChannelOptions WithMaxReceiveMessageSize(int maxReceiveMessageSize)
Parameters
Type Name Description
System.Int32 maxReceiveMessageSize

The new maximum receive message size, in bytes.

Returns
Type Description
GrpcChannelOptions

The new options.

WithMaxSendMessageSize(Int32)

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

Declaration
public GrpcChannelOptions WithMaxSendMessageSize(int maxSendMessageSize)
Parameters
Type Name Description
System.Int32 maxSendMessageSize

The new maximum send message size, in bytes.

Returns
Type Description
GrpcChannelOptions

The new options.

WithPrimaryUserAgent(String)

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

Declaration
public GrpcChannelOptions WithPrimaryUserAgent(string primaryUserAgent)
Parameters
Type Name Description
System.String primaryUserAgent

The new primary user agent. Must not be null.

Returns
Type Description
GrpcChannelOptions

The new options.

Back to top