Inheritance: extends Stream, implements AsyncStreamInterface, use trait Kraken\Loop\LoopAwareTrait
Beispiel #1
0
 /**
  * @param string|resource $endpointOrResource
  * @param LoopInterface $loop
  * @param mixed[] $config
  * @throws InstantiationException
  */
 public function __construct($endpointOrResource, LoopInterface $loop, $config = [])
 {
     try {
         if (!is_resource($endpointOrResource)) {
             $endpointOrResource = $this->createClient($endpointOrResource, $config);
         }
         parent::__construct($endpointOrResource, $loop);
     } catch (Error $ex) {
         throw new InstantiationException('SocketClient could not be created.');
     } catch (Exception $ex) {
         throw new InstantiationException('SocketClient could not be created.');
     }
 }