Kraken\Network\NetworkServer::__construct PHP Method

__construct() public method

public __construct ( Kraken\Ipc\Socket\SocketListenerInterface $listener, mixed[] $params = [] )
$listener Kraken\Ipc\Socket\SocketListenerInterface
$params mixed[]
    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);
        }
    }