protected function connect()
        {
                $this->_socket=@stream_socket_client(
                        $this->hostname.':'.$this->port,
                        $errorNumber,
                        $errorDescription,
                        $this->timeout ? $this->timeout : ini_get("default_socket_timeout")
                );
                if ($this->_socket)
                {
                        if($this->password!==null)
                                $this->executeCommand('AUTH',array($this->password));
                        $this->executeCommand('SELECT',array($this->database));
                }
                else
                        throw new CException('Failed to connect to redis: '.$errorDescription,(int)$errorNumber);
        }