/** * Send a ping to the server. * * @param string $to * @return void */ public function ping($to) { $iq = new Iq(array('from' => $this->getFrom(), 'id' => uniqid(), 'to' => $to, 'type' => 'get')); $iq->initDom(new DOMElement('ping', null, 'urn:xmpp:ping')); $this->stream->send((string) $iq); }
/** * @param string $type * @return Iq */ protected function getIq($type = null) { $iq = new Iq($this->options); if (isset($type)) { $iq->setType($type); } return $iq; }