101captain
2021-09-13 4e6437ebb364e79a3f79de418b05600b16b63290
修改netty相关配置
1个文件已修改
5 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/netty/NettyServer.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/netty/NettyServer.java
@@ -14,7 +14,8 @@
@Slf4j
public class NettyServer {
    private static Integer port=20012;
    private static final Integer port=20012;
    private static final String host="47.104.148.185";
    public void start() {
        //new 一个主线程组
        EventLoopGroup bossGroup = new NioEventLoopGroup(1);
@@ -30,7 +31,7 @@
                .childOption(ChannelOption.SO_KEEPALIVE, true);
        //绑定端口,开始接收进来的连接
        try {
            ChannelFuture future = bootstrap.bind(port).sync();
            ChannelFuture future = bootstrap.bind(host,port).sync();
            log.info("服务器启动开始监听端口: {}", port);
            future.channel().closeFuture().sync();
        } catch (InterruptedException e) {