private function getRemodeAddr()
    {
        $ip = NULL;
        if(PHP_SAPI=='cli') {
            $ip = gethostbyname(gethostname());
        } elseif($this->hasServerRemoteAddr()) {
            $ip = $this->server['REMOTE_ADDR'];
        } elseif($this->hasEnvRemoteAddr()) {
            $ip = $this->env['REMOTE_ADDR'];
        }
        return $ip;
    }