wzy
2021-02-28 d3cdbf19b53e24a1417364b098f7b8f71f36a208
src/main/java/com/xcong/excoin/netty/client/ClientChannelHandler.java
@@ -1,5 +1,6 @@
package com.xcong.excoin.netty.client;
import com.xcong.excoin.netty.common.ClientChannelManager;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import lombok.extern.slf4j.Slf4j;
@@ -19,7 +20,7 @@
    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        log.info("消息收到");
        ClientChannelManager.addServerGroup(ctx.channel());
    }
    @Override
@@ -27,4 +28,8 @@
        log.info("消息收到");
    }
    @Override
    public void channelInactive(ChannelHandlerContext ctx) throws Exception {
        ClientChannelManager.removeServerGroup(ctx.channel());
    }
}