Skip to content

Commit 6675520

Browse files
LichKing-leeok2c
authored andcommitted
Clarify behavior of the protocol level responseTimeout and the connection management level socketTimeout and their interrelation
1 parent cb2ccda commit 6675520

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

httpclient5/src/main/java/org/apache/hc/client5/http/config/ConnectionConfig.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,15 @@ public Builder setSocketTimeout(final int soTimeout, final TimeUnit timeUnit) {
149149
}
150150

151151
/**
152-
* Determines the default socket timeout value for I/O operations.
152+
* Determines the default socket timeout value for I/O operations on
153+
* connections created by this configuration.
154+
* A timeout value of zero is interpreted as an infinite timeout.
155+
* <p>
156+
* This value acts as a baseline at the connection management layer.
157+
* This parameter overrides the socket timeout setting applied at the I/O layer
158+
* and in its tuen can overridden by settings applied at the protocol layer
159+
* for the duration of a message exchange.
160+
* </p>
153161
* <p>
154162
* Default: {@code null} (undefined)
155163
* </p>

httpclient5/src/main/java/org/apache/hc/client5/http/config/RequestConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,10 @@ public Builder setConnectTimeout(final long connectTimeout, final TimeUnit timeU
517517
* HTTP transports with message multiplexing.
518518
* </p>
519519
* <p>
520+
* This parameter overrides the socket timeout setting applied at the connection
521+
* management or I/O layers for the duration of a message exchange.
522+
* </p>
523+
* <p>
520524
* Please note that response timeout is not a deadline. Its absolute value
521525
* can be exceeded, for example, in case of automatic request re-execution.
522526
* Please make sure the automatic request re-execution policy has been

0 commit comments

Comments
 (0)