Commit 8473ae0b authored by 赵啸非's avatar 赵啸非

物联网1.0

parent e7d94d13
......@@ -33,14 +33,14 @@ import static com.mortals.xhx.common.key.Constant.*;
public class NettyUDPServerHandler extends SimpleChannelInboundHandler<DatagramPacket> {
@Value("${application.registerApiPath:/api/register}")
private String registerApiPath;
@Value("${application.deviceInitApiPath:/api/deviceInit}")
private String deviceInitApiPath;
@Value("${application.deviceUpdateApiPath:/api/deviceUpdate}")
private String deviceUpdateApiPath;
@Value("${server.servlet.context-path:/m}")
private String servletPath;
//@Value("${application.registerApiPath:/api/register}")
private String registerApiPath="/api/register";
//@Value("${application.deviceInitApiPath:/api/deviceInit}")
private String deviceInitApiPath="/api/deviceInit";
//@Value("${application.deviceUpdateApiPath:/api/deviceUpdate}")
private String deviceUpdateApiPath="/api/deviceUpdate";
//@Value("${server.servlet.context-path:/m}")
private String servletPath="/m";
private DeviceService deviceService;
......
......@@ -52,7 +52,7 @@ public class UDPClientApp {
}
});
try {
Channel channel = bootstrap.bind(7789).sync().channel();
Channel channel = bootstrap.bind(8074).sync().channel();
channel.closeFuture().sync().await();
} catch (Exception e) {
e.printStackTrace();
......
......@@ -34,7 +34,7 @@ public class UDPClientHandler extends SimpleChannelInboundHandler<DatagramPacket
for (int i = 0; i < 10; i++) {
log.info("send msg:{}",i);
ctx.writeAndFlush(new DatagramPacket(Unpooled.copiedBuffer("我在广播" + i, Charset.forName("utf-8")),
new InetSocketAddress("192.168.0.98", 7788)));
new InetSocketAddress("192.168.0.216", 8074)));
try {
TimeUnit.SECONDS.sleep(2);
} catch (InterruptedException e) {
......
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