1: //Define Array for 1 Cache Host
   2: List<DataCacheServerEndpoint> servers = new List<DataCacheServerEndpoint>(1);
   3:  
   4: //Specify Cache Host Details 
   5: //  Parameter 1 = host name
   6: //  Parameter 2 = cache port number
   7: servers.Add(new DataCacheServerEndpoint("localhost", 22233));
   8:  
   9: //Create cache configuration
  10: DataCacheFactoryConfiguration configuration = new DataCacheFactoryConfiguration();
  11:  
  12: //Set the cache host(s)
  13: configuration.Servers = servers;
  14:  
  15: //Set default properties for local cache (local cache disabled)
  16: configuration.LocalCacheProperties = new DataCacheLocalCacheProperties();
  17:  
  18: //Disable exception messages since this sample works on a cache aside
  19: DataCacheClientLogManager.ChangeLogLevel(System.Diagnostics.TraceLevel.Off);
  20:  
  21: //Pass configuration settings to cacheFactory constructor
  22: myCacheFactory = new DataCacheFactory(configuration);
  23:  
  24: //Get reference to named cache called "default"
  25: myDefaultCache = myCacheFactory.GetCache("default");
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。