Beispiel #1
0
 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.
 }
Beispiel #2
0
 public function disconnect()
 {
     $this->connector->disconnect();
 }
Beispiel #3
0
 public function __construct($address)
 {
     parent::__construct();
     $this->onReceive->add([$this, '_onPacket']);
     $this->_address = $address;
 }