Skip to content

Commit be5a807

Browse files
author
Steve Briskin
committed
JAVA-553 change connection timeout default from unlimited to 10 sec.
1 parent 0da01d1 commit be5a807

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/com/mongodb/MongoOptions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void reset(){
3434
connectionsPerHost = Bytes.CONNECTIONS_PER_HOST;
3535
threadsAllowedToBlockForConnectionMultiplier = 5;
3636
maxWaitTime = 1000 * 60 * 2;
37-
connectTimeout = 0;
37+
connectTimeout = 1000 * 10;
3838
socketTimeout = 0;
3939
socketKeepAlive = false;
4040
autoConnectRetry = false;
@@ -118,9 +118,9 @@ else if (safe)
118118
public int maxWaitTime;
119119

120120
/**
121-
* The connection timeout in milliseconds.
121+
* The connection timeout in milliseconds. A value of 0 means no timeout.
122122
* It is used solely when establishing a new connection {@link java.net.Socket#connect(java.net.SocketAddress, int) }
123-
* Default is 0 and means no timeout.
123+
* Default is 10,000.
124124
*/
125125
public int connectTimeout;
126126

0 commit comments

Comments
 (0)