Skip to content

Commit a14bb7e

Browse files
authored
Clarify that socketTimeoutMS affects only reads (#975)
JAVA-4664
1 parent f38f8e4 commit a14bb7e

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

driver-core/src/main/com/mongodb/ConnectionString.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import com.mongodb.connection.ClusterSettings;
2020
import com.mongodb.connection.ConnectionPoolSettings;
21+
import com.mongodb.connection.SocketSettings;
2122
import com.mongodb.diagnostics.logging.Logger;
2223
import com.mongodb.diagnostics.logging.Loggers;
2324
import com.mongodb.internal.dns.DefaultDnsResolver;
@@ -121,7 +122,8 @@
121122
* <li>{@code tlsAllowInvalidHostnames=true|false}: Whether to allow invalid host names for TLS connections. Supersedes the
122123
* sslInvalidHostNameAllowed option</li>
123124
* <li>{@code connectTimeoutMS=ms}: How long a connection can take to be opened before timing out.</li>
124-
* <li>{@code socketTimeoutMS=ms}: How long a send or receive on a socket can take before timing out.</li>
125+
* <li>{@code socketTimeoutMS=ms}: How long a receive on a socket can take before timing out.
126+
* This option is the same as {@link SocketSettings#getReadTimeout(TimeUnit)}.</li>
125127
* <li>{@code maxIdleTimeMS=ms}: Maximum idle time of a pooled connection. A connection that exceeds this limit will be closed</li>
126128
* <li>{@code maxLifeTimeMS=ms}: Maximum life time of a pooled connection. A connection that exceeds this limit will be closed</li>
127129
* </ul>

driver-legacy/src/main/com/mongodb/MongoClientOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public int getConnectTimeout() {
281281
}
282282

283283
/**
284-
* <p>The socket timeout in milliseconds. It is used for I/O socket read and write operations {@link
284+
* <p>The socket timeout in milliseconds. It is used for I/O socket read operations {@link
285285
* java.net.Socket#setSoTimeout(int)}</p>
286286
*
287287
* <p>Default is 0 and means no timeout.</p>

driver-legacy/src/main/com/mongodb/MongoClientURI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@
100100
* <li>{@code tlsAllowInvalidHostnames=true|false}: Whether to allow invalid host names for TLS connections. Supersedes the
101101
* sslInvalidHostNameAllowed option</li>
102102
* <li>{@code connectTimeoutMS=ms}: How long a connection can take to be opened before timing out.</li>
103-
* <li>{@code socketTimeoutMS=ms}: How long a send or receive on a socket can take before timing out.</li>
103+
* <li>{@code socketTimeoutMS=ms}: How long a receive on a socket can take before timing out.
104+
* This option is the same as {@link MongoClientOptions#getSocketTimeout()}.</li>
104105
* <li>{@code maxIdleTimeMS=ms}: Maximum idle time of a pooled connection. A connection that exceeds this limit will be closed</li>
105106
* <li>{@code maxLifeTimeMS=ms}: Maximum life time of a pooled connection. A connection that exceeds this limit will be closed</li>
106107
* </ul>

0 commit comments

Comments
 (0)