Ver código fonte

mongodb访问方式变更

tags/v1.0.0^2
林万龙 3 anos atrás
pai
commit
a48c298d71
1 arquivos alterados com 1 adições e 1 exclusões
  1. +1
    -1
      src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java

+ 1
- 1
src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java Ver arquivo

@@ -105,7 +105,7 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
//接收msg消息与上一章节相比,此处已经不需要自己进行解码} //接收msg消息与上一章节相比,此处已经不需要自己进行解码}
SocketChannel channel = (SocketChannel) ctx.channel(); SocketChannel channel = (SocketChannel) ctx.channel();
String ipAddress = channel.remoteAddress().getAddress().toString();
String ipAddress = channel.remoteAddress().getHostString().toString();
//String message = " 接收到消息:{0}, 客户端IP:{1}"; //String message = " 接收到消息:{0}, 客户端IP:{1}";
log.info("接收到消息:" + msg + ",客户端IP:" + ipAddress); log.info("接收到消息:" + msg + ",客户端IP:" + ipAddress);
// if (nettyServerHandler.positionConfig != null) { // if (nettyServerHandler.positionConfig != null) {


Carregando…
Cancelar
Salvar