public function __construct($endpointOrResource, LoopInterface $loop, $config = [])
{
try {
if (!is_resource($endpointOrResource)) {
$endpointOrResource = $this->createServer($endpointOrResource, $config);
}
$this->socket = $endpointOrResource;
$this->loop = $loop;
$this->open = true;
$this->paused = true;
$this->resume();
} catch (Error $ex) {
throw new InstantiationException('SocketServer could not be created.', $ex);
} catch (Exception $ex) {
throw new InstantiationException('SocketServer could not be created.', $ex);
}
}