private boolean tryCompleteSessionPromise(ChannelHandlerContext ctx) {
        if (protocol == null || !channelActivated) {
            return false;
        }
        if (poolKey.proxyConfig.proxyType() != ProxyType.DIRECT && proxyDestinationAddress == null) {
            // ProxyConnectionEvent is necessary for a proxied connection.
            return false;
        }
        if (protocol.isExplicitHttp2() && !isSettingsFrameReceived) {
            // Http2Settings should be received for HTTP/2.
            return false;
        }

        if (sessionTimeoutFuture != null) {
            sessionTimeoutFuture.cancel(false);
        }
        if (sessionPromise.trySuccess(channel) || sessionPromise.isSuccess()) {
            // The session is created successfully or has already been created.
        } else {
            // The session creation has been failed already; close the connection.
            ctx.close();
        }
        return true;
    }
Tries to complete the {@link #sessionPromise} if the session is ready to serve.

@return {@code true} if the {@link #sessionPromise} has been completed successfully or exceptionally.
        {@code false} if the {@link #sessionPromise} is still incomplete.
core/src/main/java/com/linecorp/armeria/client/HttpSessionHandler.java