Class CacheConnectionOptions
Instance of this class can be used to define the parameters at the time of client connection with the cache.
Inheritance
Namespace:
Assembly: Alachisoft.NCache.Client.dll
Syntax
public class CacheConnectionOptions : object
Examples
Following example demonstrates how to use CacheConnectionOptions to get instance of ICache from CacheManager.
CacheConnectionOptions cacheConnectionOptions = new CacheConnectionOptions();
cacheConnectionOptions.LoadBalance = true;
cacheConnectionOptions.ConnectionRetries = 5;
cacheConnectionOptions.Mode = IsolationLevel.OutProc;
cacheConnectionOptions.ClientRequestTimeOut = TimeSpan.FromSeconds(30);
cacheConnectionOptions.UserCredentials = new Credentials("domain\\user-id", "password");
cacheConnectionOptions.RetryInterval = TimeSpan.FromSeconds(5);
cacheConnectionOptions.ServerList = new List<ServerInfo>();
{
new ServerInfo("remoteServer",9800)
};
ICache cache = CacheManager.GetCache("demoCache", cacheConnectionOptions);
Properties
Name | Description |
---|---|
AppName | If different client applications are connected to server and because of any issue which results in connection failure with server, after the client again establishes connection “AppName” is used to identify these different client applications. Data type is string. Its optional.If value is not set it takes the value of the process id. |
ClientBindIP | Gets/Sets the IP for the client to be binded with |
ClientCacheMode | Gets/Sets ClientCacheSyncMode to specify how the Client cache is synchronized with the cluster caches through events. |
ClientRequestTimeOut | Clients operation timeout specified in seconds. Clients wait for the response from the server for this time. If the response is not received within this time, the operation is not successful. Based on the network conditions, OperationTimeout value can be adjusted. The default value is 90 seconds. |
CommandRetries | If client application sends request to server for any operation and a response is not received, then the number of retries it will make until it gets response is defined here. |
CommandRetryInterval | In case if client app doesn’t get response against some operation call on server, the command retry interval defines the waiting period before the next attempt to send the operation the server is made. Type integer which defines seconds. |
ConnectionRetries | Number of tries to re-establish a broken connection between client and server. |
ConnectionTimeout | Client's connection timeout specified in seconds. |
DefaultReadThruProvider | Gets/Sets ID of DefaultReadThruProvider |
DefaultWriteThruProvider | Gets/Sets ID of DefaultWriteThruProvider |
EnableClientLogs | Enables client logs. |
EnableKeepAlive | Sets the keep alive flag. |
KeepAliveInterval | Gets or Sets the KeepAliveInterval, which will be in effect if the EnabledKeepAlive is set 'true' or is specified 'true' from the client configuration. Note: If the value to be set is lesser than 1 or is greater than 7200 (2 hours in seconds), it will resort back 30 seconds internally. |
LoadBalance | When this flag is set, client tries to connect to the optimum server in terms of number of connected clients. This way almost equal number of clients are connected to every node in the clustered cache and no single node is overburdened. |
LogLevel | Sets the LogLevel either as Info, Error or Debug. |
Mode | Gets/Sets the IsolationLevel of the cache. |
RetryConnectionDelay | The time after which client will try to reconnect to the server. |
RetryInterval | Time in seconds to wait between two connection retries. |
RetryL1ConnectionInterval | retry clientcahe connection interval. |
ServerList | List of Alachisoft.NCache.Client.ServerInfo in the cache. |
SkipUnAvailableClientCache | Skip clientcahe if not available. |
UserCredentials | Gets/Sets Credentials for the authentication of connection with the cache. This information is required when the security is enabled. |
Methods
Name | Description |
---|---|
Clone() | Creates a new object that is a copy of the current instance. |