From 6d27af552460498e3de4aac333cd2082f908a6d7 Mon Sep 17 00:00:00 2001 From: zhansheng <1213034643@qq.com> Date: Wed, 7 Jul 2021 08:44:20 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BF=83=E8=B7=B3=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=EF=BC=8C=E9=98=B2=E6=AD=A2=E8=AE=BE=E5=A4=87=E5=B9=B2?= =?UTF-8?q?=E5=9D=8F=E4=BA=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cn/org/hentai/jtt1078/app/VideoServerApp.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/cn/org/hentai/jtt1078/app/VideoServerApp.java b/src/main/java/cn/org/hentai/jtt1078/app/VideoServerApp.java index 23cbd8a..bfe021e 100644 --- a/src/main/java/cn/org/hentai/jtt1078/app/VideoServerApp.java +++ b/src/main/java/cn/org/hentai/jtt1078/app/VideoServerApp.java @@ -19,8 +19,9 @@ import org.slf4j.LoggerFactory; import sun.misc.Signal; import sun.misc.SignalHandler; - +import io.netty.handler.timeout.IdleStateHandler; import java.net.InetAddress; +import java.util.concurrent.TimeUnit; /** * Created by matrixy on 2019/4/9. @@ -71,6 +72,7 @@ private static void start() throws Exception @Override protected void initChannel(final SocketChannel channel) throws Exception { ChannelPipeline p = channel.pipeline(); + p.addLast(new IdleStateHandler(10,0,0, TimeUnit.SECONDS)); p.addLast(new Jtt1078MessageDecoder()); // p.addLast(new Jtt808MessageEncoder()); // p.addLast(new JTT808Handler());