Skip to content

Commit

Permalink
添加心跳检测,防止设备干坏事
Browse files Browse the repository at this point in the history
  • Loading branch information
liupinjin authored and gitee-org committed Jul 7, 2021
1 parent 55d4b1e commit 6d27af5
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 6d27af5

Please sign in to comment.