Пример #1
0
 public static void Dispose()
 {
     if (prcm != null)
     {
         prcm.Dispose();
     }
 }
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 /// 时间:2016/8/4 15:54
 /// 备注:
 public void Dispose()
 {
     if (PRM != null)
     {
         PRM.Dispose();
     }
 }
Пример #3
0
        private bool ConnectToRedis()
        {
            var redisDB = MasterServerSettings.Default.RedisDB.Trim();

            if (string.IsNullOrWhiteSpace(redisDB))
            {
                log.InfoFormat("Application {0}/{1} starts without Redis", this.ApplicationId, this.Version);
                return(false);
            }

            PooledRedisClientManager manager = null;

            try
            {
                manager = new PooledRedisClientManager(redisDB);
                using (var client = manager.GetDisposableClient <RedisClient>())
                {
                    client.Client.Ping();
                }

                this.redisManager = manager;
            }
            catch (Exception e)
            {
                if (manager != null)
                {
                    manager.Dispose();
                }
                log.WarnFormat("Exception through connection to redis at '{0}'. Will continue without Redis", redisDB);
                log.WarnFormat("Exception: {0}", e);

                return(false);
            }
            return(true);
        }
Пример #4
0
 public void dispose()
 {
     if (_prcm != null)
     {
         _prcm.Dispose();
         _prcm = null;  //销毁对象
     }
 }
Пример #5
0
 public void Dispose()
 {
     clientManager.Dispose();
     if (clientFactory.IsValueCreated)
     {
         clientFactory.Value.Dispose();
     }
 }
Пример #6
0
 public void Close()
 {
     try
     {
         if (redisManager != null)
         {
             redisManager.Dispose();
         }
     }
     catch { }
 }
Пример #7
0
Файл: Redis.cs Проект: vanehu/MM
 /// <summary>
 /// 释放
 /// </summary>
 public void Dispose()
 {
     if (_Redis != null)
     {
         _Redis.Dispose();
         _Redis = null;
     }
     if (conn != null)
     {
         conn.Dispose();
         conn = null;
     }
 }
Пример #8
0
        /// <summary>
        /// 关闭客户端连接
        /// </summary>
        /// <returns></returns>
        public bool Close()
        {
            var result = true;

            try
            {
                _cachePool.Dispose();
            }
            catch
            {
                result = false;
            }
            return(result);
        }
Пример #9
0
 public void Dispose()
 {
     clientManager.Dispose();
 }
Пример #10
0
        public void Close()
        {
            var client = prcm.GetClient();

            prcm.Dispose();
        }
 public void Dispose()
 {
     _clientManager?.Dispose();
 }