我刚安装好
Velocity
连接到缓存主机的代码(工作正常):
// Define Array for 1 cache host.
ServerEndPoint[] servers = new ServerEndPoint[1];
// Specify Cache Host Details
servers[0] = new ServerEndPoint(
"COMPUTERNAME" /* Host */,
22233 /* Port */,
"DistributedCacheService" /* Service name */);
// Pass configuration settings to CacheFactory constructor.
m_cacheFactory = new CacheFactory(servers,
true /* Use routing client */,
false /* No local cache */);
// Get the cache (works fine).
Cache cache = m_cacheFactory.GetCache("MyCache");
将对象添加到缓存的我的代码(不起作用):
// Get the cache.
Cache cache = m_cacheFactory.GetCache("MyCache");
// Create the item to put in the cache.
Product product = new Product();
product.Sku = "10000";
product.Name = "My Product";
// Put the object in the cache (The add method doesn't work either).
cache.Put(product.Sku /* Key */, product /* Value */);
通过集群管理员界面,我已经验证了缓存主机是否正在运行以及缓存本身是否存在。
有人知道问题出在哪里吗?
编辑:
CASClient-尝试对话时超时
到
网tcp://l1441gbg:22233/distributedcacheservice,Velocity.DRM.SendReceive,Warning,2008-11-20
11:06:29.988