wzy
2021-02-28 d3cdbf19b53e24a1417364b098f7b8f71f36a208
src/main/java/com/xcong/excoin/netty/handler/TcpServerHandler.java
@@ -1,6 +1,6 @@
package com.xcong.excoin.netty.handler;
import com.xcong.excoin.netty.common.ChannelManager;
import com.xcong.excoin.netty.common.ServerChannelManager;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
@@ -20,13 +20,13 @@
    @Override
    public void channelActive(ChannelHandlerContext ctx) {
        log.info("[tcp客户端连入服务器]");
        ChannelManager.addTcpChannel(ctx.channel());
        ServerChannelManager.addTcpChannel(ctx.channel());
    }
    @Override
    public void channelInactive(ChannelHandlerContext ctx) {
        log.info("[tcp客户端断开服务器]");
        ChannelManager.removeTcpChannel(ctx.channel());
        ServerChannelManager.removeTcpChannel(ctx.channel());
    }
    @Override