Close the connection but not the client (#13600)
* Close the connection but not the client * Close the connection but not the client
This commit is contained in:
parent
7a3ad4ab41
commit
2cf54f7947
|
|
@ -131,7 +131,8 @@ public class NettyConnectionClient extends AbstractConnectionClient {
|
|||
|
||||
NettyConfigOperator operator = new NettyConfigOperator(nettyChannel, getChannelHandler());
|
||||
protocol.configClientPipeline(getUrl(), operator, nettySslContextOperator);
|
||||
ch.closeFuture().addListener(channelFuture -> doClose());
|
||||
// set null but do not close this client, it will be reconnect in the future
|
||||
ch.closeFuture().addListener(channelFuture -> channel.set(null));
|
||||
// TODO support Socks5
|
||||
}
|
||||
});
|
||||
|
|
@ -150,9 +151,7 @@ public class NettyConnectionClient extends AbstractConnectionClient {
|
|||
current.close();
|
||||
}
|
||||
this.channel.set(null);
|
||||
if (!closePromise.isDone()) {
|
||||
closePromise.setSuccess(null);
|
||||
}
|
||||
closePromise.setSuccess(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,9 @@ public class TriplePingPongHandler extends ChannelDuplexHandler {
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
ctx.close();
|
||||
if (ctx.channel().isActive()) {
|
||||
ctx.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue