using System;
namespace CB.Cache.MemCached
{
///
/// Cache配置模型
///
public class MemCachedConfigInfo
{
///
/// 服务器列表
///
public string[] ServerList { get; set; }
public string PoolName
{
set { _poolname = value; }
get { return string.IsNullOrEmpty(_poolname) ? "Sam.CB.Cache.MemCahed" : _poolname; }
}
private string _poolname;
///
/// 初始化链接数
///
public int InitConnections
{
get { return _initconnections > 0 ? _initconnections : 3; }
set { _initconnections = value; }
}
private int _initconnections;
///
/// 最少链接数
///
public int MinConnections
{
get { return _minconnection > 0 ? _minconnection : 3; }
set { _minconnection = value; }
}
private int _minconnection;
///
/// 最大连接数
///
public int MaxConnections
{
get { return _maxconnections > 0 ? _maxconnections : 5; }
set { _maxconnections = value; }
}
private int _maxconnections;
///
/// Socket链接超时时间
///
public int SocketConnectTimeout
{
get { return _socketconnecttimeout > 1000 ? _socketconnecttimeout : 1000; }
set { _socketconnecttimeout = value; }
}
private int _socketconnecttimeout;
///
/// socket超时时间
///
public int SocketTimeout
{
get { return _sockettimeout > 1000 ? _sockettimeout : 3000; }
set { _sockettimeout = value; }
}
private int _sockettimeout;
///
/// 维护线程休息时间
///
public int MaintenanceSleep
{
get { return _maintenancesleep > 0 ? _maintenancesleep : 30; }
set { _maintenancesleep = value; }
}
private int _maintenancesleep;
///
/// 链接失败后是否重启,详情参见http://baike.baidu.com/view/1084309.htm
///
public bool FailOver
{
get { return _failover; }
set { _failover = value; }
}
private bool _failover;
///
/// 是否用nagle算法启动socket
///
public bool Nagle
{
get { return _nagle; }
set { _nagle = value; }
}
private bool _nagle;
}
}