Class RouteSelector

java.lang.Object
com.squareup.okhttp.internal.http.RouteSelector

public final class RouteSelector
extends Object
Selects routes to connect to an origin server. Each connection requires a choice of proxy server, IP address, and TLS mode. Connections may also be recycled.
  • Constructor Details

  • Method Details

    • hasNext

      public boolean hasNext()
      Returns true if there's another route to attempt. Every address has at least one route.
    • next

      public Connection next​(String method) throws IOException
      Returns the next route address to attempt.
      Throws:
      NoSuchElementException - if there are no more routes to attempt.
      IOException
    • connectFailed

      public void connectFailed​(Connection connection, IOException failure)
      Clients should invoke this method when they encounter a connectivity failure on a connection returned by this route selector.