public function withPort($port)
    {
        $new = clone $this;
        try {
            $new->setPort($port);
        } catch (InvalidArgumentException $ex) {
            throw new InvalidArgumentException('Invalid port provided.', null, $ex);
        }

        return $new;
    }