/** * Attempt to recover from failure to connect via a route. Returns a new HTTP engine * that should be used for the retry if there are other routes to try, or null if * there are no more routes to try. */ public HttpEngine recover(RouteException e) { if (!streamAllocation.recover(e)) { return null; } if (!client.getRetryOnConnectionFailure()) { return null; } StreamAllocation streamAllocation = close(); // For failure recovery, use the same route selector with a new connection. return new HttpEngine(client, userRequest, bufferRequestBody, callerWritesRequestBody, forWebSocket, streamAllocation, (RetryableSink) requestBodyOut, priorResponse); }
/** * Report and attempt to recover from a failure to communicate with a server. Returns a new HTTP * engine that should be used for the retry if {@code e} is recoverable, or null if the failure is * permanent. Requests with a body can only be recovered if the body is buffered. */ public HttpEngine recover(IOException e, Sink requestBodyOut) { if (!streamAllocation.recover(e, requestBodyOut)) { return null; } if (!client.retryOnConnectionFailure()) { return null; } StreamAllocation streamAllocation = close(); // For failure recovery, use the same route selector with a new connection. return new HttpEngine(client, userRequest, bufferRequestBody, callerWritesRequestBody, forWebSocket, streamAllocation, (RetryableSink) requestBodyOut, priorResponse); }
/** * Report and attempt to recover from a failure to communicate with a server. Returns a new * HTTP engine that should be used for the retry if {@code e} is recoverable, or null if * the failure is permanent. Requests with a body can only be recovered if the * body is buffered. */ public HttpEngine recover(IOException e, Sink requestBodyOut) { if (!streamAllocation.recover(e, requestBodyOut)) { return null; } if (!client.getRetryOnConnectionFailure()) { return null; } StreamAllocation streamAllocation = close(); // For failure recovery, use the same route selector with a new connection. return new HttpEngine(client, userRequest, bufferRequestBody, callerWritesRequestBody, forWebSocket, streamAllocation, (RetryableSink) requestBodyOut, priorResponse); }
/** * Attempt to recover from failure to connect via a route. Returns a new HTTP engine * that should be used for the retry if there are other routes to try, or null if * there are no more routes to try. */ public HttpEngine recover(RouteException e) { if (!streamAllocation.recover(e)) { return null; } if (!client.getRetryOnConnectionFailure()) { return null; } StreamAllocation streamAllocation = close(); // For failure recovery, use the same route selector with a new connection. return new HttpEngine(client, userRequest, bufferRequestBody, callerWritesRequestBody, forWebSocket, streamAllocation, (RetryableSink) requestBodyOut, priorResponse); }
/** * Report and attempt to recover from a failure to communicate with a server. Returns a new * HTTP engine that should be used for the retry if {@code e} is recoverable, or null if * the failure is permanent. Requests with a body can only be recovered if the * body is buffered. */ public HttpEngine recover(IOException e, Sink requestBodyOut) { if (!streamAllocation.recover(e, requestBodyOut)) { return null; } if (!client.getRetryOnConnectionFailure()) { return null; } StreamAllocation streamAllocation = close(); // For failure recovery, use the same route selector with a new connection. return new HttpEngine(client, userRequest, bufferRequestBody, callerWritesRequestBody, forWebSocket, streamAllocation, (RetryableSink) requestBodyOut, priorResponse); }
engine = new HttpEngine(client, request, false, false, forWebSocket, null, null, null); engine = new HttpEngine(client, request, false, false, forWebSocket, streamAllocation, null, response);
engine = new HttpEngine(client, request, false, false, forWebSocket, null, null, null); engine = new HttpEngine(client, request, false, false, forWebSocket, streamAllocation, null, response);
engine = new HttpEngine(client, request, false, false, forWebSocket, null, null, null); engine = new HttpEngine(client, request, false, false, forWebSocket, streamAllocation, null, response);