Skip to content

Commit 2a73678

Browse files
committed
Added javadoc note for Connection#timeout
Fixes #1883
1 parent 3f70665 commit 2a73678

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/main/java/org/jsoup/Connection.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,16 @@ default Connection newRequest(URL url) {
145145
Connection userAgent(String userAgent);
146146

147147
/**
148-
* Set the total request timeout duration. If a timeout occurs, an {@link java.net.SocketTimeoutException} will be thrown.
149-
* <p>The default timeout is <b>30 seconds</b> (30,000 millis). A timeout of zero is treated as an infinite timeout.
150-
* <p>Note that this timeout specifies the combined maximum duration of the connection time and the time to read
151-
* the full response.
152-
* @param millis number of milliseconds (thousandths of a second) before timing out connects or reads.
153-
* @return this Connection, for chaining
154-
* @see #maxBodySize(int)
148+
Set the total maximum request duration. If a timeout occurs, an {@link java.net.SocketTimeoutException} will be
149+
thrown.
150+
<p>The default timeout is <b>30 seconds</b> (30,000 millis). A timeout of zero is treated as an infinite timeout.</p>
151+
<p>This timeout specifies the combined maximum duration of the connection time and the time to read
152+
the full response.</p>
153+
<p>Implementation note: when this <code>Connection</code> is backed by <code>HttpURLConnection</code> (rather than <code>HttpClient</code>, as used in JRE/JDK 11+), this timeout is implemented by setting both the socket connect and read timeouts to half of the specified value.</p>
154+
155+
@param millis number of milliseconds (thousandths of a second) before timing out connects or reads.
156+
@return this Connection, for chaining
157+
@see #maxBodySize(int)
155158
*/
156159
Connection timeout(int millis);
157160

0 commit comments

Comments
 (0)