Package com.squareup.okhttp
Class RouteDatabase
java.lang.Object
com.squareup.okhttp.RouteDatabase
public final class RouteDatabase extends Object
A blacklist of failed routes to avoid when creating a new connection to a
target address. This is used so that OkHttp can learn from its mistakes: if
there was a failure attempting to connect to a specific IP address, proxy
server or TLS mode, that failure is remembered and alternate routes are
preferred.
-
Constructor Summary
Constructors Constructor Description RouteDatabase() -
Method Summary
Modifier and Type Method Description voidconnected(Route route)Records success connecting tofailedRoute.voidfailed(Route failedRoute, IOException failure)Records a failure connecting tofailedRoute.intfailedRoutesCount()booleanshouldPostpone(Route route)Returns true ifroutehas failed recently and should be avoided.
-
Constructor Details
-
RouteDatabase
public RouteDatabase()
-
-
Method Details
-
failed
Records a failure connecting tofailedRoute. -
connected
Records success connecting tofailedRoute. -
shouldPostpone
Returns true ifroutehas failed recently and should be avoided. -
failedRoutesCount
public int failedRoutesCount()
-