Пример #1
0
        private KetamaHashingAlgorithm_FNV1a32Bit hashingAlgorithm;                   //The hashing algorithm object to actually do our hashing

        /// <summary>
        /// Initializing the KetamaContinuum object.
        /// </summary>
        /// <param name="serverIP">A string containing server 'IP:port/weight' values (e.g. '10.10.10.10:1234/5')
        /// Can separate multiple IP:port/weight inputs via commas,  (e.g. '10.10.10.10:1234/5, 20.20.20.20:2345/6') in order
        /// to pass in multiple servers to connect to at once.</param>
        public KetamaContinuum(string serverIP = null)
        {
            _continuum = new SortedDictionary<uint, string>();
            hashingAlgorithm = new KetamaHashingAlgorithm_FNV1a32Bit();
            ketamaServers = new KetamaServers();
            if (serverIP != null) { SyncServerConections(serverIP); }
        }
Пример #2
0
        private KetamaHashingAlgorithm_FNV1a32Bit hashingAlgorithm;                   //The hashing algorithm object to actually do our hashing

        /// <summary>
        /// Initializing the KetamaContinuum object.
        /// </summary>
        /// <param name="serverIP">A string containing server 'IP:port/weight' values (e.g. '10.10.10.10:1234/5')
        /// Can separate multiple IP:port/weight inputs via commas,  (e.g. '10.10.10.10:1234/5, 20.20.20.20:2345/6') in order
        /// to pass in multiple servers to connect to at once.</param>
        public KetamaContinuum(string serverIP = null)
        {
            _continuum       = new SortedDictionary <uint, string>();
            hashingAlgorithm = new KetamaHashingAlgorithm_FNV1a32Bit();
            ketamaServers    = new KetamaServers();
            if (serverIP != null)
            {
                SyncServerConections(serverIP);
            }
        }