문제

Unable to get stored memcached client value

this does not retrive the value of TEST , what is the wrong in this code?

Console.Out.WriteLine("START:");

                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);
            }
도움이 되었습니까?

해결책

I found the solution , before run this code i would have installed the memcached.exe

http://zurmo.org/wiki/installing-memcache-on-windows

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top