Exemple #1
0
        /// <summary>
        /// 根据缓存Key获取其所存储的服务器信息
        /// </summary>
        /// <param name="key">缓存Key</param>
        /// <returns>Key所存储的服务器信息</returns>
        public static string GetHostInfoByCacheKey(string key)
        {
            string hostInfo = "";

            SockIO sock = null;

            try
            {
                sock = SockIOPool.GetInstance(SocketPoolName).GetSock(key);

                if (sock != null)
                {
                    hostInfo = sock.Host;
                }
            }
            finally
            {
                if (sock != null)
                {
                    sock.Close();
                }
            }

            return(hostInfo);
        }