@@ -50,6 +50,9 @@ public class ReplicaSetStatus {
50
50
static final int UNAUTHENTICATED_ERROR_CODE = 10057 ;
51
51
52
52
ReplicaSetStatus ( Mongo mongo , List <ServerAddress > initial ){
53
+ _mongoOptions = _mongoOptionsDefaults .copy ();
54
+ _mongoOptions .socketFactory = mongo ._options .socketFactory ;
55
+
53
56
_mongo = mongo ;
54
57
_all = Collections .synchronizedList ( new ArrayList <Node >() );
55
58
for ( ServerAddress addr : initial ){
@@ -541,15 +544,16 @@ public int getMaxBsonObjectSize() {
541
544
static int inetAddrCacheMS ;
542
545
static float latencySmoothFactor ;
543
546
544
- static final MongoOptions _mongoOptions = new MongoOptions ();
547
+ final MongoOptions _mongoOptions ;
548
+ static final MongoOptions _mongoOptionsDefaults = new MongoOptions ();
545
549
546
550
static {
547
551
updaterIntervalMS = Integer .parseInt (System .getProperty ("com.mongodb.updaterIntervalMS" , "5000" ));
548
552
slaveAcceptableLatencyMS = Integer .parseInt (System .getProperty ("com.mongodb.slaveAcceptableLatencyMS" , "15" ));
549
553
inetAddrCacheMS = Integer .parseInt (System .getProperty ("com.mongodb.inetAddrCacheMS" , "300000" ));
550
554
latencySmoothFactor = Float .parseFloat (System .getProperty ("com.mongodb.latencySmoothFactor" , "4" ));
551
- _mongoOptions .connectTimeout = Integer .parseInt (System .getProperty ("com.mongodb.updaterConnectTimeoutMS" , "20000" ));
552
- _mongoOptions .socketTimeout = Integer .parseInt (System .getProperty ("com.mongodb.updaterSocketTimeoutMS" , "20000" ));
555
+ _mongoOptionsDefaults .connectTimeout = Integer .parseInt (System .getProperty ("com.mongodb.updaterConnectTimeoutMS" , "20000" ));
556
+ _mongoOptionsDefaults .socketTimeout = Integer .parseInt (System .getProperty ("com.mongodb.updaterSocketTimeoutMS" , "20000" ));
553
557
}
554
558
555
559
static final DBObject _isMasterCmd = new BasicDBObject ( "ismaster" , 1 );
0 commit comments