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());