Memcached c# simple example

github link Install using nuget
 
PM> Install-Package EnyimMemcached
 
            MemcachedClientConfiguration config = new MemcachedClientConfiguration();
            IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse("10.10.4.98"), 11211);
            config.Servers.Add(remoteEP);
            config.Protocol = MemcachedProtocol.Text;

            //using - not recommended here, check out documentation
            using (var mc = new MemcachedClient(config))
            {
                //get
                var zz = mc.Get("test_" + x);

                //set
                mc.Store(StoreMode.Set, "Test", "Hello World");
            }

No comments:

Post a Comment