public function __construct($server, $port = 5222) { parent::__construct(); $this->_server = $server; $this->_port = $port; $this->onReceive->add([$this, '_onPacket']); $this->keepAliveTimer = new Timer(15, [$this, 'keepAliveTick']); $this->keepAliveTimer->stop(); // We don't want to run this before connection is finalized. }
public function disconnect() { $this->connector->disconnect(); }
public function __construct($address) { parent::__construct(); $this->onReceive->add([$this, '_onPacket']); $this->_address = $address; }