File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -293,7 +293,7 @@ private synchronized void ensureOpen(final Mongo mongo) throws IOException {
293
293
successfullyConnected = true ;
294
294
}
295
295
catch ( IOException e ){
296
- close ();
296
+ reset ();
297
297
298
298
if (!_options .autoConnectRetry || (provider != null && !provider .hasWorked ()))
299
299
throw e ;
@@ -388,8 +388,12 @@ public boolean isClosed() {
388
388
@ Override
389
389
public void close (){
390
390
closed = true ;
391
+ reset ();
392
+ }
393
+
394
+ private void reset () {
391
395
authenticatedDatabases .clear ();
392
-
396
+
393
397
if ( _socket != null ){
394
398
try {
395
399
_socket .close ();
@@ -398,7 +402,7 @@ public void close(){
398
402
// don't care
399
403
}
400
404
}
401
-
405
+
402
406
_in = null ;
403
407
_out = null ;
404
408
_socket = null ;
You can’t perform that action at this time.
0 commit comments