Top Description Methods
org.apache.hc.core5.http.io

public Interface ResponseOutOfOrderStrategy

Known Direct Implementers
org.apache.hc.core5.http.impl.io.MonitoringResponseOutOfOrderStrategy, org.apache.hc.core5.http.impl.io.NoResponseOutOfOrderStrategy
Annotations
@Internal
Imports
org.apache.hc.core5.annotation.Internal, org.apache.hc.core5.http.ClassicHttpRequest, java.io.IOException, .InputStream

Represents a strategy to determine how frequently the client should check for an out of order response. An out of order response is sent before the server has read the full request. If the client fails to check for an early response then a java.net.SocketException or java.net.SocketTimeoutException may be thrown while writing the request entity after a timeout is reached on either the client or server.
Since
5.1

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True if an early response was detected, otherwise false.
isEarlyResponseDetected
(ClassicHttpRequest
The current request.
request
,
HttpClientConnection
The connection used to send the current request.
connection
,
InputStream
The response stream, this may be used to check for an early response.
inputStream
,
long
Number of bytes that have already been sent.
totalBytesSent
,
long
The size of a socket write operation that will follow this check.
nextWriteSize
)

Called before each write to the to a socket java.io.OutputStream with the number of bytes that have already been sent, and the size of the write that will occur if this check does not encounter an out of order response.

Method Detail

isEarlyResponseDetectedback to summary
public boolean isEarlyResponseDetected(ClassicHttpRequest request, HttpClientConnection connection, InputStream inputStream, long totalBytesSent, long nextWriteSize) throws IOException

Called before each write to the to a socket java.io.OutputStream with the number of bytes that have already been sent, and the size of the write that will occur if this check does not encounter an out of order response.

Parameters
request:ClassicHttpRequest

The current request.

connection:HttpClientConnection

The connection used to send the current request.

inputStream:InputStream

The response stream, this may be used to check for an early response.

totalBytesSent:long

Number of bytes that have already been sent.

nextWriteSize:long

The size of a socket write operation that will follow this check.

Returns:boolean

True if an early response was detected, otherwise false.

Exceptions
IOException:
in case of a network failure while checking for an early response.