AMQPConnection::setPort PHP Méthode

setPort() public méthode

Set the port used to connect to the AMQP broker.
public setPort ( integer $port ) : boolean
$port integer The port used to connect to the AMQP broker.
Résultat boolean TRUE on success or FALSE on failure.
    public function setPort($port)
    {
    }

Usage Example

Exemple #1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     if (empty($this->user)) {
         throw new \Exception("Parameter 'user' was not set for AMQP connection.");
     }
     if (empty(self::$ampqConnection)) {
         self::$ampqConnection = new \AMQPConnection();
         self::$ampqConnection->setHost($this->host);
         self::$ampqConnection->setPort($this->port);
         self::$ampqConnection->setLogin($this->user);
         self::$ampqConnection->setPassword($this->password);
         self::$ampqConnection->setVhost($this->vhost);
         self::$ampqConnection->connect();
     }
 }
All Usage Examples Of AMQPConnection::setPort