public sealed class GrpcChannelOptions : IEquatable<GrpcChannelOptions>Portable abstraction of channel options
Implements
IEquatable<GrpcChannelOptions>Namespace
Google.Api.Gax.GrpcAssembly
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 | |
|---|---|
| Type | Description |
IReadOnlyList<GrpcChannelOptions.CustomOption> |
|
Empty
public static GrpcChannelOptions Empty { get; }An empty set of channel options.
| Property Value | |
|---|---|
| Type | Description |
GrpcChannelOptions |
|
EnableServiceConfigResolution
public bool? EnableServiceConfigResolution { get; }If non-null, explicitly enables or disables service configuration resolution.
| Property Value | |
|---|---|
| Type | Description |
Nullable<Boolean> |
|
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 | |
|---|---|
| Type | Description |
Nullable<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 | |
|---|---|
| Type | Description |
Nullable<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 | |
|---|---|
| Type | Description |
Nullable<Int32> |
|
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 | |
|---|---|
| Type | Description |
Nullable<Int32> |
|
PrimaryUserAgent
public string PrimaryUserAgent { get; }If non-null, explicitly specifies the primary user agent for the channel.
| Property Value | |
|---|---|
| Type | Description |
String |
|
Methods
Equals(GrpcChannelOptions)
public bool Equals(GrpcChannelOptions other)| Parameter | |
|---|---|
| Name | Description |
other |
GrpcChannelOptions |
| Returns | |
|---|---|
| Type | Description |
Boolean |
|
Equals(Object)
public override bool Equals(object obj)| Parameter | |
|---|---|
| Name | Description |
obj |
Object |
| Returns | |
|---|---|
| Type | Description |
Boolean |
|
GetHashCode()
public override int GetHashCode()| Returns | |
|---|---|
| Type | Description |
Int32 |
|
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 | |
|---|---|
| Name | Description |
overlaidOptions |
GrpcChannelOptionsThe overlaid options. Must not be null. |
| Returns | |
|---|---|
| Type | Description |
GrpcChannelOptions |
The new merged options. |
WithCustomOption(GrpcChannelOptions.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 | |
|---|---|
| Name | Description |
option |
GrpcChannelOptions.CustomOptionThe additional custom option to include. Must not be null. |
| Returns | |
|---|---|
| Type | Description |
GrpcChannelOptions |
The new options. |
WithCustomOption(String, Int32)
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 | |
|---|---|
| Name | Description |
name |
StringThe name of the new custom option. Must not be null. |
value |
Int32The value of the new custom option. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
name |
StringThe name of the new custom option. Must not be null. |
value |
StringThe value of the new custom option. Must not be null. |
| Returns | |
|---|---|
| Type | Description |
GrpcChannelOptions |
The new options. |
WithEnableServiceConfigResolution(Boolean)
public GrpcChannelOptions WithEnableServiceConfigResolution(bool enableServiceConfigResolution)Returns a new instance with the same options as this one, but with EnableServiceConfigResolution set to
enableServiceConfigResolution.
| Parameter | |
|---|---|
| Name | Description |
enableServiceConfigResolution |
BooleanThe new option for enabling service config resolution. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
keepAliveTime |
TimeSpanThe new keep-alive time. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
keepAliveTimeout |
TimeSpanThe new keep-alive timeout. |
| Returns | |
|---|---|
| Type | Description |
GrpcChannelOptions |
The new options. |
WithMaxReceiveMessageSize(Int32)
public GrpcChannelOptions WithMaxReceiveMessageSize(int maxReceiveMessageSize)Returns a new instance with the same options as this one, but with MaxReceiveMessageSize set to
maxReceiveMessageSize.
| Parameter | |
|---|---|
| Name | Description |
maxReceiveMessageSize |
Int32The new maximum receive message size, in bytes. |
| Returns | |
|---|---|
| Type | Description |
GrpcChannelOptions |
The new options. |
WithMaxSendMessageSize(Int32)
public GrpcChannelOptions WithMaxSendMessageSize(int maxSendMessageSize)Returns a new instance with the same options as this one, but with MaxSendMessageSize set to
maxSendMessageSize.
| Parameter | |
|---|---|
| Name | Description |
maxSendMessageSize |
Int32The new maximum send message size, in bytes. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
primaryUserAgent |
StringThe new primary user agent. Must not be null. |
| Returns | |
|---|---|
| Type | Description |
GrpcChannelOptions |
The new options. |