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
AllowAdmin
Indicates whether admin operations should be allowed
public bool AllowAdmin { get; set; }
Property Value
ChannelPrefix
Automatically encodes and decodes channels
public RedisChannel ChannelPrefix { get; set; }
Property Value
ClientName
The client name to use for all connections
public string ClientName { get; set; }
Property Value
CommandMap
The command-map associated with this configuration
public CommandMap CommandMap { get; set; }
Property Value
ConfigCheckSeconds
Check configuration every n seconds (every minute by default)
public int ConfigCheckSeconds { get; set; }
Property Value
ConfigurationChannel
Channel to use for broadcasting and listening for configuration change notification
public string ConfigurationChannel { get; set; }
Property Value
ConnectRetry
The number of times to repeat the initial connect cycle if no servers respond promptly
public int ConnectRetry { get; set; }
Property Value
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
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
EndPoints
The endpoints defined for this configuration
public EndPointCollection EndPoints { get; }
Property Value
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
KeepAlive
Specifies the time in seconds at which connections should be pinged to ensure validity
public int KeepAlive { get; set; }
Property Value
Password
The password to use to authenticate with the server
public string Password { get; set; }
Property Value
Proxy
Type of proxy to use (if any); for example Proxy.Twemproxy
public Proxy Proxy { get; set; }
Property Value
ReconnectRetryPolicy
The retry policy to be used for connection reconnects
public IReconnectRetryPolicy ReconnectRetryPolicy { get; set; }
Property Value
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
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
ServiceName
The service name used to resolve a service via sentinel
public string ServiceName { get; set; }
Property Value
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
Ssl
Indicates whether the connection should be encrypted
public bool Ssl { get; set; }
Property Value
SslHost
The target-host to use when validating SSL certificate; setting a value here enables SSL mode
public string SslHost { get; set; }
Property Value
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
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
TieBreaker
Tie-breaker used to choose between masters (must match the endpoint exactly)
public string TieBreaker { get; set; }
Property Value
WriteBuffer
The size of the output buffer to use
public int WriteBuffer { get; set; }
Property Value
Methods
Clone()
Create a copy of the configuration
public ConfigurationOptions Clone()
Returns
Parse(string)
Parse the configuration from a comma-delimited configuration string
public static ConfigurationOptions Parse(string configuration)
Parameters
configuration
string
Returns
Exceptions
- ArgumentNullException
configuration
isnull
.- 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
Returns
Exceptions
- ArgumentNullException
configuration
isnull
.- 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
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
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
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