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