protected function connect($hostname, $port)
    {
        $memcache = new Memcached();

        // API requires to add server first
        $memcache->addServer($hostname, $port);

        // Finally we try to connect
        try {
            @$memcache->connect($hostname, $port);

        } catch (Exception $e) {
            throw new Doozr_Cache_Service_Exception(
                sprintf('Error while connecting to host: "%s" on Port: "%s". Connection failed.', $hostname, $port)
            );
        }

        // return instance on success
        return $memcache;
    }
protected function connect($hostname, $port)
    {
        $memcache = new Memcached();

        // API requires to add server first
        $memcache->addServer($hostname, $port);

        // Finally we try to connect
        try {
            @$memcache->connect($hostname, $port);

        } catch (Exception $e) {
            throw new Doozr_Cache_Service_Exception(
                sprintf('Error while connecting to host: "%s" on Port: "%s". Connection failed.', $hostname, $port)
            );
        }

        // return instance on success
        return $memcache;
    }
protected function connect ( $ hostname , $ port ) { $ memcache = new Memcached ( ) ; // API requires to add server first $ memcache -> addServer ( $ hostname , $ port ) ; // Finally we try to connect try { @ $ memcache -> connect ( $ hostname , $ port ) ; } catch ( Exception $ e ) { throw new Doozr_Cache_Service_Exception ( sprintf ( 'Error while connecting to host: "%s" on Port: "%s". Connection failed.' , $ hostname , $ port ) ) ; } // return instance on success return $ memcache ; }
Connects to a server.

@param string $hostname The hostname to connect to
@param string $port     The port to connect to

@author Benjamin Carl <opensource@clickalicious.de>
@return Memcached The created instance of memcache
@access protected
@throws Doozr_Cache_Service_Exception
Connects to a server .