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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnectFailed(Route failedRoute, IOException failure)Clients should invoke this method when they encounter a connectivity failure on a connection returned by this route selector.static RouteSelectorget(Address address, Request request, OkHttpClient client)booleanhasNext()Returns true if there's another route to attempt.Routenext()
-
-
-
Method Detail
-
get
public static RouteSelector get(Address address, Request request, OkHttpClient client) throws IOException
- Throws:
IOException
-
hasNext
public boolean hasNext()
Returns true if there's another route to attempt. Every address has at least one route.
-
next
public Route next() throws IOException
- Throws:
IOException
-
connectFailed
public void connectFailed(Route failedRoute, IOException failure)
Clients should invoke this method when they encounter a connectivity failure on a connection returned by this route selector.
-
-