Table of Contents

Class ConfigurationOptions

Namespace
StackExchange.Redis
Assembly
StackExchange.Redis.StrongName.dll

The options relevant to a set of redis connections

public sealed class ConfigurationOptions : ICloneable
Inheritance
ConfigurationOptions
Implements
Inherited Members

Constructors

ConfigurationOptions()

public ConfigurationOptions()

Properties

AbortOnConnectFail

Gets or sets whether connect/configuration timeouts should be explicitly notified via a TimeoutException

public bool AbortOnConnectFail { get; set; }

Property Value

bool

AllowAdmin

Indicates whether admin operations should be allowed

public bool AllowAdmin { get; set; }

Property Value

bool

ChannelPrefix

Automatically encodes and decodes channels

public RedisChannel ChannelPrefix { get; set; }

Property Value

RedisChannel

ClientName

The client name to use for all connections

public string ClientName { get; set; }

Property Value

string

CommandMap

The command-map associated with this configuration

public CommandMap CommandMap { get; set; }

Property Value

CommandMap

ConfigCheckSeconds

Check configuration every n seconds (every minute by default)

public int ConfigCheckSeconds { get; set; }

Property Value

int

ConfigurationChannel

Channel to use for broadcasting and listening for configuration change notification

public string ConfigurationChannel { get; set; }

Property Value

string

ConnectRetry

The number of times to repeat the initial connect cycle if no servers respond promptly

public int ConnectRetry { get; set; }

Property Value

int

ConnectTimeout

Specifies the time in milliseconds that should be allowed for connection (defaults to 5 seconds unless SyncTimeout is higher)

public int ConnectTimeout { get; set; }

Property Value

int

DefaultDatabase

Specifies the default database to be used when calling ConnectionMultiplexer.GetDatabase() without any parameters

public int? DefaultDatabase { get; set; }

Property Value

int?

DefaultVersion

The server version to assume

public Version DefaultVersion { get; set; }

Property Value

Version

EndPoints

The endpoints defined for this configuration

public EndPointCollection EndPoints { get; }

Property Value

EndPointCollection

HighPrioritySocketThreads

Use ThreadPriority.AboveNormal for SocketManager reader and writer threads (true by default). If false, ThreadPriority.Normal will be used.

public bool HighPrioritySocketThreads { get; set; }

Property Value

bool

KeepAlive

Specifies the time in seconds at which connections should be pinged to ensure validity

public int KeepAlive { get; set; }

Property Value

int

Password

The password to use to authenticate with the server

public string Password { get; set; }

Property Value

string

Proxy

Type of proxy to use (if any); for example Proxy.Twemproxy

public Proxy Proxy { get; set; }

Property Value

Proxy

ReconnectRetryPolicy

The retry policy to be used for connection reconnects

public IReconnectRetryPolicy ReconnectRetryPolicy { get; set; }

Property Value

IReconnectRetryPolicy

ResolveDns

Indicates whether endpoints should be resolved via DNS before connecting. If enabled the ConnectionMultiplexer will not re-resolve DNS when attempting to re-connect after a connection failure.

public bool ResolveDns { get; set; }

Property Value

bool

ResponseTimeout

Specifies the time in milliseconds that the system should allow for responses before concluding that the socket is unhealthy (defaults to SyncTimeout)

public int ResponseTimeout { get; set; }

Property Value

int

ServiceName

The service name used to resolve a service via sentinel

public string ServiceName { get; set; }

Property Value

string

SocketManager

Gets or sets the SocketManager instance to be used with these options; if this is null a per-multiplexer SocketManager is created automatically.

public SocketManager SocketManager { get; set; }

Property Value

SocketManager

Ssl

Indicates whether the connection should be encrypted

public bool Ssl { get; set; }

Property Value

bool

SslHost

The target-host to use when validating SSL certificate; setting a value here enables SSL mode

public string SslHost { get; set; }

Property Value

string

SslProtocols

Configures which Ssl/TLS protocols should be allowed. If not set, defaults are chosen by the .NET framework.

public SslProtocols? SslProtocols { get; set; }

Property Value

SslProtocols?

SyncTimeout

Specifies the time in milliseconds that the system should allow for synchronous operations (defaults to 1 second)

public int SyncTimeout { get; set; }

Property Value

int

TieBreaker

Tie-breaker used to choose between masters (must match the endpoint exactly)

public string TieBreaker { get; set; }

Property Value

string

WriteBuffer

The size of the output buffer to use

public int WriteBuffer { get; set; }

Property Value

int

Methods

Clone()

Create a copy of the configuration

public ConfigurationOptions Clone()

Returns

ConfigurationOptions

Parse(string)

Parse the configuration from a comma-delimited configuration string

public static ConfigurationOptions Parse(string configuration)

Parameters

configuration string

Returns

ConfigurationOptions

Exceptions

ArgumentNullException

configuration is null.

ArgumentException

configuration is empty.

Parse(string, bool)

Parse the configuration from a comma-delimited configuration string

public static ConfigurationOptions Parse(string configuration, bool ignoreUnknown)

Parameters

configuration string
ignoreUnknown bool

Returns

ConfigurationOptions

Exceptions

ArgumentNullException

configuration is null.

ArgumentException

configuration is empty.

SetDefaultPorts()

Resolve the default port for any endpoints that did not have a port explicitly specified

public void SetDefaultPorts()

ToString()

Returns the effective configuration string for this configuration, including Redis credentials.

public override string ToString()

Returns

string

ToString(bool)

Returns the effective configuration string for this configuration with the option to include or exclude the password from the string.

public string ToString(bool includePassword)

Parameters

includePassword bool

Returns

string

Events

CertificateSelection

A LocalCertificateSelectionCallback delegate responsible for selecting the certificate used for authentication; note that this cannot be specified in the configuration-string.

public event LocalCertificateSelectionCallback CertificateSelection

Event Type

LocalCertificateSelectionCallback

CertificateValidation

A RemoteCertificateValidationCallback delegate responsible for validating the certificate supplied by the remote party; note that this cannot be specified in the configuration-string.

public event RemoteCertificateValidationCallback CertificateValidation

Event Type

RemoteCertificateValidationCallback