public static AsyncConnect asyncConnect(final Context ctx) {
    """
	Begin an attempt at creating a connection which can be completed by calling {@link AsyncConnect#poll()} until
	it returns the client, before complete it will return null.
	
	@param ctx for the cluster.
	@return the {@link AsyncConnect} that can be polled for completion.
    """
        Subscription subscription = null;
        try
        {
            ctx.conclude();

            final long deadlineNs = ctx.aeron().context().nanoClock().nanoTime() + ctx.messageTimeoutNs();
            subscription = ctx.aeron().addSubscription(ctx.egressChannel(), ctx.egressStreamId());

            return new AsyncConnect(ctx, subscription, deadlineNs);
        }
        catch (final Exception ex)
        {
            if (!ctx.ownsAeronClient())
            {
                CloseHelper.quietClose(subscription);
            }

            ctx.close();

            throw ex;
        }
    }
public static AsyncConnect asyncConnect(final Context ctx)
    {
        Subscription subscription = null;
        try
        {
            ctx.conclude();

            final long deadlineNs = ctx.aeron().context().nanoClock().nanoTime() + ctx.messageTimeoutNs();
            subscription = ctx.aeron().addSubscription(ctx.egressChannel(), ctx.egressStreamId());

            return new AsyncConnect(ctx, subscription, deadlineNs);
        }
        catch (final Exception ex)
        {
            if (!ctx.ownsAeronClient())
            {
                CloseHelper.quietClose(subscription);
            }

            ctx.close();

            throw ex;
        }
    }
public static AsyncConnect asyncConnect ( final Context ctx ) { Subscription subscription = null ; try { ctx . conclude ( ) ; final long deadlineNs = ctx . aeron ( ) . context ( ) . nanoClock ( ) . nanoTime ( ) + ctx . messageTimeoutNs ( ) ; subscription = ctx . aeron ( ) . addSubscription ( ctx . egressChannel ( ) , ctx . egressStreamId ( ) ) ; return new AsyncConnect ( ctx , subscription , deadlineNs ) ; } catch ( final Exception ex ) { if ( ! ctx . ownsAeronClient ( ) ) { CloseHelper . quietClose ( subscription ) ; } ctx . close ( ) ; throw ex ; } }
Begin an attempt at creating a connection which can be completed by calling {@link AsyncConnect#poll()} until
it returns the client, before complete it will return null.

@param ctx for the cluster.
@return the {@link AsyncConnect} that can be polled for completion.
Begin an attempt at creating a connection which can be completed by calling { @link AsyncConnect#poll () } until it returns the client before complete it will return null .