public sealed class GrpcChannelOptions : IEquatable<GrpcChannelOptions>Portable abstraction of channel options
Implements
IEquatableGrpcChannelOptionsNamespace
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 |
IReadOnlyListGrpcChannelOptionsCustomOption |
|
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 |
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 | |
|---|---|
| Type | Description |
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 |
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 |
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 | |
|---|---|
| Type | Description |
int |
|
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 |
bool |
|
Equals(object)
public override bool Equals(object obj)| Parameter | |
|---|---|
| Name | Description |
obj |
object |
| Returns | |
|---|---|
| Type | Description |
bool |
|
GetHashCode()
public override int GetHashCode()| Returns | |
|---|---|
| Type | Description |
int |
|
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(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 |
GrpcChannelOptionsCustomOptionThe additional custom option to include. Must not be null. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
name |
stringThe name of the new custom option. Must not be null. |
value |
intThe 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(bool)
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 |
boolThe 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(int)
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 |
intThe new maximum receive message size, in bytes. |
| Returns | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
maxSendMessageSize |
intThe 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. |