コード例 #1
0
        public static Server EnsureServer(Cluster cluster, string hostname, int memcachedPort)
        {
            var id = Server.GetId(hostname, memcachedPort);
            var server = cluster.GetServerById(id);
            if (server == null)
            {
                server = new Server(hostname, memcachedPort);
                cluster.AddServer(server);
            }

            return server;
        }