Show / Hide Table of Contents

Class ChannelOption

Channel option specified when creating a channel. Corresponds to grpc_channel_args from grpc/grpc.h. Commonly used channel option names are defined in ChannelOptions, but any of the GRPC_ARG_* channel options names defined in grpc_types.h can be used.

Inheritance
System.Object
ChannelOption
Implements
System.IEquatable<ChannelOption>
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: Grpc.Core
Assembly: Grpc.Core.dll
Syntax
public sealed class ChannelOption : IEquatable<ChannelOption>

Constructors

ChannelOption(String, Int32)

Creates a channel option with an integer value.

Declaration
public ChannelOption(string name, int intValue)
Parameters
Type Name Description
System.String name

Name.

System.Int32 intValue

Integer value.

ChannelOption(String, String)

Creates a channel option with a string value.

Declaration
public ChannelOption(string name, string stringValue)
Parameters
Type Name Description
System.String name

Name.

System.String stringValue

String value.

Properties

IntValue

Gets the integer value the ChannelOption.

Declaration
public int IntValue { get; }
Property Value
Type Description
System.Int32

Name

Gets the name of the ChannelOption.

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

StringValue

Gets the string value the ChannelOption.

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

Type

Gets the type of the ChannelOption.

Declaration
public ChannelOption.OptionType Type { get; }
Property Value
Type Description
ChannelOption.OptionType

Methods

Equals(ChannelOption)

Determines whether the specified object is equal to the current object.

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

Equals(Object)

Determines whether the specified object is equal to the current 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()

A hash code for the current object.

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

Operators

Equality(ChannelOption, ChannelOption)

Equality operator.

Declaration
public static bool operator ==(ChannelOption option1, ChannelOption option2)
Parameters
Type Name Description
ChannelOption option1
ChannelOption option2
Returns
Type Description
System.Boolean

Inequality(ChannelOption, ChannelOption)

Inequality operator.

Declaration
public static bool operator !=(ChannelOption option1, ChannelOption option2)
Parameters
Type Name Description
ChannelOption option1
ChannelOption option2
Returns
Type Description
System.Boolean
Back to top