Browse Source

rpc

pull/3/MERGE
CalvinKirs 4 years ago
parent
commit
d2f136ba09
  1. 11
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/rpc/remote/NettyClientHandler.java

11
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/rpc/remote/NettyClientHandler.java

@ -5,6 +5,10 @@ import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.ChannelInboundHandlerAdapter;
import org.apache.dolphinscheduler.remote.utils.ChannelUtils;
import java.net.InetSocketAddress;
/** /**
* @author jiangli * @author jiangli
* @date 2021-01-13 13:33 * @date 2021-01-13 13:33
@ -20,12 +24,15 @@ public class NettyClientHandler extends ChannelInboundHandlerAdapter {
@Override @Override
public void channelActive(ChannelHandlerContext ctx) throws Exception { public void channelActive(ChannelHandlerContext ctx) throws Exception {
super.channelActive(ctx);
ctx.channel().close();
} }
@Override @Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception { public void channelInactive(ChannelHandlerContext ctx) throws Exception {
super.channelInactive(ctx); InetSocketAddress address =(InetSocketAddress) ctx.channel().remoteAddress();
ctx.channel().close();
//todo connectManage.removeChannel(ctx.channel());
} }
@Override @Override

Loading…
Cancel
Save