public function connect()
    {
        list($host, $port) = explode(':', $this->getServer());
        if ($this->stream->open($host, $port, $this->getTimeout()) === false) {
            throw new Exception(sprintf('Cannot connect to server %s', $this->getServer()), Exception::SERVER_OFFLINE);
        }

        return true;
    }
public function connect()
    {
        list($host, $port) = explode(':', $this->getServer());
        if ($this->stream->open($host, $port, $this->getTimeout()) === false) {
            throw new Exception(sprintf('Cannot connect to server %s', $this->getServer()), Exception::SERVER_OFFLINE);
        }

        return true;
    }
public function connect ( ) { list ( $ host , $ port ) = explode ( ':' , $ this -> getServer ( ) ) ; if ( $ this -> stream -> open ( $ host , $ port , $ this -> getTimeout ( ) ) === false ) { throw new Exception ( sprintf ( 'Cannot connect to server %s' , $ this -> getServer ( ) ) , Exception :: SERVER_OFFLINE ) ; } return true ; }
Connect to the beanstalkd server

@throws \Beanstalk\Exception When a connection cannot be established
@return boolean
Connect to the beanstalkd server