From c8b6f74ecc29022a7f52a2ee35aa25eef3312f39 Mon Sep 17 00:00:00 2001 From: ‘liusuyi’ <1951119284@qq.com> Date: 星期三, 25 十月 2023 17:09:15 +0800 Subject: [PATCH] 海康动态链接库集成 --- src/main/java/com/ard/utils/udp/NettyUdpServer.java | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ard/utils/udp/NettyUdpServer.java b/src/main/java/com/ard/utils/udp/NettyUdpServer.java index 724458d..0891737 100644 --- a/src/main/java/com/ard/utils/udp/NettyUdpServer.java +++ b/src/main/java/com/ard/utils/udp/NettyUdpServer.java @@ -18,9 +18,8 @@ /** * 鍚姩鏈嶅姟 */ - @Async + @Async("alarm") public void init(int port) { - //琛ㄧず鏈嶅姟鍣ㄨ繛鎺ョ洃鍚嚎绋嬬粍锛屼笓闂ㄦ帴鍙� accept 鏂扮殑瀹㈡埛绔痗lient 杩炴帴 EventLoopGroup bossLoopGroup = new NioEventLoopGroup(); try { @@ -36,13 +35,13 @@ serverBootstrap = serverBootstrap.handler(new NettyUdpHandler()); //6銆佺粦瀹歴erver锛岄�氳繃璋冪敤sync锛堬級鏂规硶寮傛闃诲锛岀洿鍒扮粦瀹氭垚鍔� ChannelFuture channelFuture = serverBootstrap.bind(port).sync(); - log.info("started and listened on " + channelFuture.channel().localAddress()); + log.debug("started and listened on " + channelFuture.channel().localAddress()); //7銆佺洃鍚�氶亾鍏抽棴浜嬩欢锛屽簲鐢ㄧ▼搴忎細涓�鐩寸瓑寰咃紝鐩村埌channel鍏抽棴 channelFuture.channel().closeFuture().sync(); } catch (Exception e) { - log.error("error:"+e.getMessage()); + log.error("error:" + e.getMessage()); } finally { - log.info("netty udp close!"); + log.debug("netty udp close!"); //8 鍏抽棴EventLoopGroup锛� bossLoopGroup.shutdownGracefully(); } -- Gitblit v1.9.3