文件名从 igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grain/client/ClientHandler.java 修改 |
| | |
| | | package com.ld.igds.protocol.beibo.grain.client; |
| | | package com.ld.igds.protocol.beibo.grainv1.client; |
| | | |
| | | import com.ld.igds.protocol.beibo.grain.analysis.AnalysisService; |
| | | import com.ld.igds.protocol.beibo.grainv1.analysis.AnalysisService; |
| | | import com.ld.igds.util.BytesUtil; |
| | | import com.ld.igds.util.SpringUtil; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | import io.netty.channel.SimpleChannelInboundHandler; |
| | | import io.netty.util.internal.logging.InternalLogger; |
| | | import io.netty.util.internal.logging.InternalLoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.net.InetSocketAddress; |
| | | |
| | |
| | | public void channelActive(ChannelHandlerContext ctx) { |
| | | InetSocketAddress insocket = (InetSocketAddress) ctx.channel() |
| | | .remoteAddress(); |
| | | log.info("璐濆崥绮儏鍒嗘満鎴愬姛杩炴帴锛孖P={},port={}", insocket.getAddress() |
| | | log.info("鍒嗘満鎴愬姛杩炴帴锛孖P={},port={}", insocket.getAddress() |
| | | .getHostAddress(), insocket.getPort()); |
| | | } |
| | | |
| | |
| | | InetSocketAddress insocket = (InetSocketAddress) ctx.channel() |
| | | .remoteAddress(); |
| | | |
| | | log.info("璐濆崥绮儏鍒嗘満鏂紑杩炴帴锛孖P={},port={}", insocket.getAddress(),insocket.getPort()); |
| | | log.info("鍒嗘満鏂紑杩炴帴锛孖P={},port={}", insocket.getAddress(),insocket.getPort()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | throws Exception { |
| | | byte[] bytes = (byte[]) msg; |
| | | String result = BytesUtil.bytesToString(bytes); |
| | | log.info("璐濆崥绮儏鍒嗘満杩斿洖淇℃伅=" + result); |
| | | log.info("鍒嗘満杩斿洖淇℃伅=" + result); |
| | | |
| | | InetSocketAddress insocket = (InetSocketAddress) ctx.channel().remoteAddress(); |
| | | // InetSocketAddress insocket = (InetSocketAddress) ctx.channel().remoteAddress(); |
| | | |
| | | //瑙f瀽 |
| | | if (null == analysisService) { |
| | | analysisService = (AnalysisService) SpringUtil.getBean(AnalysisService.BEAN_ID); |
| | | } |
| | | analysisService.analysis(result); |
| | | // analysisService.analysis(result); |
| | | } |
| | | |
| | | @Override |