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.');
}
}