public function __construct(SocketListenerInterface $listener, $params = [])
{
try {
$router = new HttpRouter($http = new HttpServer($server = new SocketServer($listener)), $params);
$this->listener = $listener;
$this->server = $server;
$this->http = $http;
$this->firewall = null;
$this->router = $router;
} catch (Error $ex) {
throw new InstantiationException("[" . __CLASS__ . "] could not be created.", $ex);
} catch (Exception $ex) {
throw new InstantiationException("[" . __CLASS__ . "] could not be created.", $ex);
}
}