getConnection() 공개 메소드

Get connection object.
public getConnection ( ) : Fabiang\Xmpp\Connection\ConnectionInterface
리턴 Fabiang\Xmpp\Connection\ConnectionInterface
예제 #1
0
파일: Client.php 프로젝트: flecointre/xmpp
 /**
  * Constructor.
  *
  * @param Options               $options      Client options
  * @param EventManagerInterface $eventManager Event manager
  */
 public function __construct(Options $options, EventManagerInterface $eventManager = null)
 {
     // create default connection
     if (null !== $options->getConnection()) {
         $connection = $options->getConnection();
     } else {
         $connection = Socket::factory($options);
         $options->setConnection($connection);
     }
     $this->options = $options;
     $this->connection = $connection;
     if (null === $eventManager) {
         $eventManager = new EventManager();
     }
     $this->eventManager = $eventManager;
     $this->setupImplementation();
 }