wzy
2021-02-28 d3cdbf19b53e24a1417364b098f7b8f71f36a208
src/main/java/com/xcong/excoin/netty/handler/WebSocketServerHandler.java
@@ -1,7 +1,7 @@
package com.xcong.excoin.netty.handler;
import com.xcong.excoin.netty.common.ChannelManager;
import com.xcong.excoin.netty.common.ServerChannelManager;
import com.xcong.excoin.netty.common.Contans;
import com.xcong.excoin.netty.common.NettyTools;
import com.xcong.excoin.netty.dispatch.MsgDispatch;
@@ -50,13 +50,13 @@
    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        log.info("[websocket客户端连入服务器]-->{}", ctx.channel().id());
        ChannelManager.addWebSocketChannel(ctx.channel());
        ServerChannelManager.addWebSocketChannel(ctx.channel());
    }
    @Override
    public void channelInactive(ChannelHandlerContext ctx) throws Exception {
        log.info("[离开websocket服务器]-->{}", ctx.channel().id());
        ChannelManager.removeWebSocketChannel(ctx.channel());
        ServerChannelManager.removeWebSocketChannel(ctx.channel());
    }
    @Override