无法获取存储的 memcached 客户端值
这不会检索 TEST 的值,这段代码有什么问题?
Console.Out.WriteLine("开始:");
var cfg = new MemcachedClientConfiguration();
cfg.AddServer("127.0.0.1", 11211);
cfg.Protocol = MemcachedProtocol.Binary;
//cfg.SocketPool.MinPoolSize = 10;
//cfg.SocketPool.MaxPoolSize = 50;
//TimeSpan ts = new TimeSpan(0, 10, 0);
//cfg.SocketPool.ConnectionTimeout=ts;
//cfg.SocketPool.DeadTimeout = ts;
//cfg.SocketPool
//var m = new MemcachedClient(cfg);
MemcachedClient client = new MemcachedClient(cfg);
client.Store(StoreMode.Set, "Test2", "Hello World");
//Get a string
//var myVal = client.Get<string>("Test2");
string str = client.Get("Test2") as string;
if (str != null)
{
Console.Out.WriteLine("Fetched item with key: mystring, value: " + str);
}