Nats\ConnectionOptions::setPort PHP Method

setPort() public method

Set port.
public setPort ( integer $port )
$port integer Port.
    public function setPort($port)
    {
        $this->port = $port;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * setUp test suite
  *
  * @return void
  */
 public function setUp()
 {
     $options = new ConnectionOptions();
     if (!self::$isGnatsd) {
         time_nanosleep(1, 700000000);
         $options->setPort(4222);
     }
     $this->c = new Nats\Connection($options);
     $this->c->connect();
 }