Kraken\Ipc\Socket\SocketListener::__construct PHP Method

__construct() public method

public __construct ( string | resource $endpointOrResource, Kraken\Loop\LoopInterface $loop, mixed[] $config = [] )
$endpointOrResource string | resource
$loop Kraken\Loop\LoopInterface
$config mixed[]
    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);
        }
    }