设置采集间隔初始化默认值5分钟
增加指令更新采集间隔
This commit is contained in:
@@ -2,13 +2,13 @@ package com.tongran.agentserver.server.netty;
|
||||
|
||||
import com.tongran.agentserver.server.netty.config.AgentNettyConfig;
|
||||
import com.tongran.agentserver.server.netty.handler.DecoderHandler;
|
||||
import com.tongran.agentserver.server.netty.handler.EncoderHandler;
|
||||
import com.tongran.agentserver.server.netty.handler.NettyClientHandler;
|
||||
import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.channel.*;
|
||||
import io.netty.channel.nio.NioEventLoopGroup;
|
||||
import io.netty.channel.socket.SocketChannel;
|
||||
import io.netty.channel.socket.nio.NioSocketChannel;
|
||||
import io.netty.handler.codec.string.StringEncoder;
|
||||
import io.netty.handler.timeout.IdleStateHandler;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -60,7 +60,7 @@ public class NettyTcpClient {
|
||||
ChannelPipeline pipeline = ch.pipeline();
|
||||
// 添加编解码器
|
||||
pipeline.addLast("decoder", new DecoderHandler());
|
||||
pipeline.addLast("encoder", new StringEncoder());
|
||||
pipeline.addLast("encoder", new EncoderHandler());
|
||||
// 添加心跳机制
|
||||
pipeline.addLast("idleStateHandler",
|
||||
new IdleStateHandler(0, 0, 90, TimeUnit.SECONDS));
|
||||
|
||||
Reference in New Issue
Block a user