From 2c783432245859f3ee745e4e9d8cc98dfa7c0865 Mon Sep 17 00:00:00 2001 From: 邱宇豪 <qyh123230312> Date: 星期二, 21 十一月 2023 11:28:46 +0800 Subject: [PATCH] 20231121_qiuyh_调整巡检打卡、防患举报导出 --- hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/netty/NettyServer.java | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/netty/NettyServer.java b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/netty/NettyServer.java index 7714221..dd652fa 100644 --- a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/netty/NettyServer.java +++ b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/netty/NettyServer.java @@ -8,6 +8,7 @@ import io.netty.channel.socket.nio.NioServerSocketChannel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; @@ -28,6 +29,9 @@ */ private EventLoopGroup work = new NioEventLoopGroup(); + @Value("${netty.port}") + private String port; + /** * 启动Netty Server * @@ -40,7 +44,7 @@ // 指定Channel .channel(NioServerSocketChannel.class) //使用指定的端口设置套接字地址 - .localAddress(new InetSocketAddress(10001)) + .localAddress(new InetSocketAddress(Integer.parseInt(port))) //服务端可连接队列数,对应TCP/IP协议listen函数中backlog参数 .option(ChannelOption.SO_BACKLOG, 1024) -- Gitblit v1.9.3