Commit c3b17e1e authored by 赵啸非's avatar 赵啸非

修改消息组件

parent e47612c5
...@@ -34,21 +34,12 @@ public class NettyUDPServerHandler extends SimpleChannelInboundHandler<DatagramP ...@@ -34,21 +34,12 @@ public class NettyUDPServerHandler extends SimpleChannelInboundHandler<DatagramP
@Override @Override
protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception { protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception {
System.out.println("111111111");
log.info("receive->UDP:{}",msg.content().toString(CharsetUtil.UTF_8)); log.info("receive->UDP:{}",msg.content().toString(CharsetUtil.UTF_8));
// TODO 设备返回服务端配置 // TODO 设备返回服务端配置
String URL = GlobalSysInfo.getParamValue(PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11021"); String URL = GlobalSysInfo.getParamValue(PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11021");
// String req = msg.content().toString(CharsetUtil.UTF_8); // String req = msg.content().toString(CharsetUtil.UTF_8);
try {
InetSocketAddress ipSocket = (InetSocketAddress) ctx.channel().remoteAddress();
String clientIp = ipSocket.getAddress().getHostAddress();
int port = ipSocket.getPort();
log.info("客户端ip地址:{} port:{}", clientIp, String.valueOf(port));
}catch (Exception e){
e.printStackTrace();
}
ApiResp<String> resp = new ApiResp<>(); ApiResp<String> resp = new ApiResp<>();
resp.setCode(YesNoEnum.YES.getValue()); resp.setCode(YesNoEnum.YES.getValue());
resp.setMsg("获取服务端地址成功!"); resp.setMsg("获取服务端地址成功!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment