File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
driver-core/src/main/com/mongodb/connection/netty Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 19
19
import com .mongodb .MongoException ;
20
20
import com .mongodb .MongoInternalException ;
21
21
import com .mongodb .MongoInterruptedException ;
22
+ import com .mongodb .MongoSocketException ;
22
23
import com .mongodb .MongoSocketOpenException ;
23
24
import com .mongodb .MongoSocketReadTimeoutException ;
24
25
import com .mongodb .ServerAddress ;
@@ -145,6 +146,12 @@ public void initChannel(final SocketChannel ch) throws Exception {
145
146
public void operationComplete (final ChannelFuture future ) throws Exception {
146
147
if (future .isSuccess ()) {
147
148
channel = channelFuture .channel ();
149
+ channel .closeFuture ().addListener (new ChannelFutureListener () {
150
+ @ Override
151
+ public void operationComplete (final ChannelFuture f2 ) throws Exception {
152
+ handleReadResponse (null , new IOException ("The connection to the server was closed" ));
153
+ }
154
+ });
148
155
handler .completed (null );
149
156
} else {
150
157
handler .failed (new MongoSocketOpenException ("Exception opening socket" , getAddress (), future .cause ()));
You can’t perform that action at this time.
0 commit comments