| | |
| | | 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; |
| | |
| | | @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 |