larksuite-oapi/src/main/java/com/larksuite/oapi/okhttp3_14/internal/connection/RealConnection.java
boolean isEligible(Address address, @Nullable List<Route> routes) {
    // If this connection is not accepting new exchanges, we're done.
    if (transmitters.size() >= allocationLimit || noNewExchanges) return false;

    // If the non-host fields of the address don't overlap, we're done.
    if (!Internal.instance.equalsNonHost(this.route.address(), address)) return false;

    // If the host exactly matches, we're done: this connection can carry the address.
    if (address.url().host().equals(this.route().address().url().host())) {
      return true; // This connection is a perfect match.
    }

    // At this point we don't have a hostname match. But we still be able to carry the request if
    // our connection coalescing requirements are met. See also:
    // https://hpbn.co/optimizing-application-delivery/#eliminate-domain-sharding
    // https://daniel.haxx.se/blog/2016/08/18/http2-connection-coalescing/

    // 1. This connection must be HTTP/2.
    if (http2Connection == null) return false;

    // 2. The routes must share an IP address.
    if (routes == null || !routeMatchesAny(routes)) return false;

    // 3. This connection's server certificate's must cover the new host.
    if (address.hostnameVerifier() != OkHostnameVerifier.INSTANCE) return false;
    if (!supportsUrl(address.url())) return false;

    // 4. Certificate pinning must match the host.
    try {
      address.certificatePinner().check(address.url().host(), handshake().peerCertificates());
    } catch (SSLPeerUnverifiedException e) {
      return false;
    }

    return true; // The caller's address can be carried by this connection.
  }
/**
   * Returns true if this connection can carry a stream allocation to {@code address}. If non-null
   * {@code route} is the resolved route for a connection.
   */
Returns true if this connection can carry a stream allocation to  address. If non-null
route is the resolved route for a connection.
Returns true if this connection can carry a stream allocation to address . If non - null route is the resolved route for a connection .
boolean isEligible(Address address, @Nullable List<Route> routes) {
    if (transmitters.size() >= allocationLimit || noNewExchanges) return false;
    if (!Internal.instance.equalsNonHost(this.route.address(), address)) return false;
    if (address.url().host().equals(this.route().address().url().host())) {
      return true; 
    }
    if (http2Connection == null) return false;
    if (routes == null || !routeMatchesAny(routes)) return false;
    if (address.hostnameVerifier() != OkHostnameVerifier.INSTANCE) return false;
    if (!supportsUrl(address.url())) return false;
    try {
      address.certificatePinner().check(address.url().host(), handshake().peerCertificates());
    } catch (SSLPeerUnverifiedException e) {
      return false;
    }
    return true; 
  }
boolean isEligible ( Address address , @ Nullable List < Route > routes ) { if ( transmitters . size ( ) >= allocationLimit || noNewExchanges ) return false ; if ( ! Internal . instance . equalsNonHost ( this . route . address ( ) , address ) ) return false ; if ( address . url ( ) . host ( ) . equals ( this . route ( ) . address ( ) . url ( ) . host ( ) ) ) { return true ; } if ( http2Connection == null ) return false ; if ( routes == null || ! routeMatchesAny ( routes ) ) return false ; if ( address . hostnameVerifier ( ) != OkHostnameVerifier . INSTANCE ) return false ; if ( ! supportsUrl ( address . url ( ) ) ) return false ; try { address . certificatePinner ( ) . check ( address . url ( ) . host ( ) , handshake ( ) . peerCertificates ( ) ) ; } catch ( SSLPeerUnverifiedException e ) { return false ; } return true ; }
Returns true if this connection can carry a stream allocation to {@code address}.
Returns true if this connection can carry a stream allocation to { @code address } .
// If this connection is not accepting new exchanges, we're done. // If the non-host fields of the address don't overlap, we're done. // If the host exactly matches, we're done: this connection can carry the address. // This connection is a perfect match. // At this point we don't have a hostname match. But we still be able to carry the request if // our connection coalescing requirements are met. See also: // https://hpbn.co/optimizing-application-delivery/#eliminate-domain-sharding // https://daniel.haxx.se/blog/2016/08/18/http2-connection-coalescing/ // 1. This connection must be HTTP/2. // 2. The routes must share an IP address. // 3. This connection's server certificate's must cover the new host. // 4. Certificate pinning must match the host. // The caller's address can be carried by this connection.