public virtual eRedisAccessError DoCommand(RedisClient redisCli) { return(eRedisAccessError.Not_Implement_The_DoCommand_Method); }
public bool Connect() { try { if (m_ip == null || m_ip.Trim() == "") { if (PrintFunc != null) { PrintFunc("Connect Redis Fail: IP==NULL"); } return(false); } if (PrintFunc != null) { PrintFunc("Start Connect Redis : IP={0}, Port={1}, Password={2}", m_ip, m_port, m_passworld); } if (m_port == 0) { m_redisCli = new RedisClient(m_ip); } else { if (m_passworld.Trim() == "") { m_redisCli = new RedisClient(m_ip, m_port); } else { m_redisCli = new RedisClient(m_ip, m_port, m_passworld); } } if (PrintFunc != null) { PrintFunc("Connect Redis Succ!"); } bool pingResult = m_redisCli.Ping(); if (pingResult == false || m_redisCli.IsSocketConnected() == false) { if (PrintFunc != null) { PrintFunc("Ping Fail Or Redis Socket Connect Fail"); } return(false); } } catch (Exception ex) { if (PrintFunc != null) { PrintFunc("FATAL : Message={0}", ex.Message); } m_redisCli = null; return(false); } return(true); }