src/main/java/com/alipay/remoting/rpc/RpcClientRemoting.java
protected Connection getConnectionAndInitInvokeContext(Url url, InvokeContext invokeContext)
                                                                                                throws RemotingException,
                                                                                                InterruptedException {
        long start = System.currentTimeMillis();
        Connection conn;
        try {
            conn = this.connectionManager.getAndCreateIfAbsent(url);
        } finally {
            if (null != invokeContext) {
                invokeContext.putIfAbsent(InvokeContext.CLIENT_CONN_CREATETIME,
                    (System.currentTimeMillis() - start));
            }
        }
        return conn;
    }
protected Connection getConnectionAndInitInvokeContext(Url url, InvokeContext invokeContext)
                                                                                                throws RemotingException,
                                                                                                InterruptedException {
        long start = System.currentTimeMillis();
        Connection conn;
        try {
            conn = this.connectionManager.getAndCreateIfAbsent(url);
        } finally {
            if (null != invokeContext) {
                invokeContext.putIfAbsent(InvokeContext.CLIENT_CONN_CREATETIME,
                    (System.currentTimeMillis() - start));
            }
        }
        return conn;
    }
protected Connection getConnectionAndInitInvokeContext ( Url url , InvokeContext invokeContext ) throws RemotingException , InterruptedException { long start = System . currentTimeMillis ( ) ; Connection conn ; try { conn = this . connectionManager . getAndCreateIfAbsent ( url ) ; } finally { if ( null != invokeContext ) { invokeContext . putIfAbsent ( InvokeContext . CLIENT_CONN_CREATETIME , ( System . currentTimeMillis ( ) - start ) ) ; } } return conn ; }
Get connection and set init invokeContext if invokeContext not {@code null}

@param url target url
@param invokeContext invoke context to set
@return connection
Get connection and set init invokeContext if invokeContext not { @code null }