예제 #1
0
 /// <summary>
 /// Static method for creating an instance. This method will throw an exception if the name already exists.
 /// </summary>
 /// <param name="name">The name of the instance.</param>
 /// <param name="servers">A list of memcached servers in standard notation: host:port. 
 /// If port is omitted, the default value of 11211 is used. 
 /// Both IP addresses and host names are accepted, for example:
 /// "localhost", "127.0.0.1", "cache01.example.com:12345", "127.0.0.1:12345", etc.</param>
 public static void Setup(string name, string[] servers)
 {
     if (instances.ContainsKey(name)) {
         throw new ConfigurationErrorsException("Trying to configure MemcachedClient instance \"" + name + "\" twice.");
     }
     instances[name] = new DME_MemcachedClient(name, servers);
 }
예제 #2
0
 public static DME_MemcachedClient GetInstance()
 {
     return defaultInstance ?? (defaultInstance = GetInstance("Default"));
 }