Skip to content

Commit

Permalink
!6 添加心跳检测,防止设备干坏事
Browse files Browse the repository at this point in the history
Merge pull request !6 from zhansheng/N/A
  • Loading branch information
glaciall authored and gitee-org committed Jul 7, 2021
2 parents a12a702 + 6d27af5 commit 6ec4b5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/cn/org/hentai/jtt1078/app/VideoServerApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 6ec4b5e

Please sign in to comment.