コード例 #1
0
ファイル: Stream.php プロジェクト: alexivenkov/xmppbot
 /**
  * Stream server.
  *
  * @param XMLEvent $event XMLEvent
  * @return void
  */
 public function streamServer(XMLEvent $event)
 {
     if (false === $event->isStartTag()) {
         $this->blocking = false;
         if ($this->getConnection()->isConnected()) {
             $this->getConnection()->disconnect();
         }
     }
 }
コード例 #2
0
ファイル: StartTls.php プロジェクト: alexivenkov/xmppbot
 /**
  * Start TLS response.
  *
  * @param XMLEvent $event XMLEvent object
  * @return void
  */
 public function proceed(XMLEvent $event)
 {
     if (false === $event->isStartTag()) {
         $this->blocking = false;
         $connection = $this->getConnection();
         if ($connection instanceof SocketConnectionInterface) {
             $connection->getSocket()->crypto(true, STREAM_CRYPTO_METHOD_SSLv23_CLIENT);
         }
         $connection->resetStreams();
         $connection->connect();
     }
 }
コード例 #3
0
 /**
  * Authentication successful.
  *
  * @param XMLEvent $event
  */
 public function success(XMLEvent $event)
 {
     if (false === $event->isStartTag()) {
         $this->blocking = false;
         $connection = $this->getConnection();
         $connection->resetStreams();
         $connection->connect();
         $this->getOptions()->setAuthenticated(true);
     }
 }
コード例 #4
0
ファイル: StreamError.php プロジェクト: alexivenkov/xmppbot
 /**
  * Throws an exception when stream error comes from input stream.
  *
  * @param \Xmppbot\Core\Event\XMLEvent $event
  * @throws StreamErrorException
  */
 public function error(XMLEvent $event)
 {
     if (false === $event->isStartTag()) {
         throw StreamErrorException::createFromEvent($event);
     }
 }