Package org.apache.hc.core5.http.impl.io
Class NoResponseOutOfOrderStrategy
- java.lang.Object
-
- org.apache.hc.core5.http.impl.io.NoResponseOutOfOrderStrategy
-
- All Implemented Interfaces:
ResponseOutOfOrderStrategy
@Contract(threading=IMMUTABLE) public final class NoResponseOutOfOrderStrategy extends java.lang.Object implements ResponseOutOfOrderStrategy
An implementation ofResponseOutOfOrderStrategywhich does not check for early responses. Early response detection requires 1ms blocking reads and incurs a hefty performance cost for large uploads.- Since:
- 5.1
- See Also:
MonitoringResponseOutOfOrderStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static NoResponseOutOfOrderStrategyINSTANCE
-
Constructor Summary
Constructors Constructor Description NoResponseOutOfOrderStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisEarlyResponseDetected(ClassicHttpRequest request, HttpClientConnection connection, java.io.InputStream inputStream, long totalBytesSent, long nextWriteSize)Called before each write to the socketIOExceptionwith the number of bytes that have already been sent, and the size of the next chunk to be written that will occur if this check does not encounter an out of order response.
-
-
-
Field Detail
-
INSTANCE
public static final NoResponseOutOfOrderStrategy INSTANCE
-
-
Method Detail
-
isEarlyResponseDetected
public boolean isEarlyResponseDetected(ClassicHttpRequest request, HttpClientConnection connection, java.io.InputStream inputStream, long totalBytesSent, long nextWriteSize)
Description copied from interface:ResponseOutOfOrderStrategyCalled before each write to the socketIOExceptionwith the number of bytes that have already been sent, and the size of the next chunk to be written that will occur if this check does not encounter an out of order response.- Specified by:
isEarlyResponseDetectedin interfaceResponseOutOfOrderStrategy- Parameters:
request- The current request.connection- The connection used to send the current request.inputStream- The response stream, this may be used to check for an early response.totalBytesSent- Number of bytes that have already been sent.nextWriteSize- The size of a socket write operation that will follow this check.- Returns:
- True if an early response was detected, otherwise false.
-
-