|
@@ -1,5 +1,7 @@
|
|
|
package com.tidecloud.dataacceptance.service;
|
|
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
+
|
|
|
import javax.annotation.PostConstruct;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -16,6 +18,7 @@ import io.netty.channel.EventLoopGroup;
|
|
|
import io.netty.channel.nio.NioEventLoopGroup;
|
|
|
import io.netty.channel.socket.SocketChannel;
|
|
|
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
|
|
+import io.netty.handler.timeout.IdleStateHandler;
|
|
|
|
|
|
/**
|
|
|
* Hello world!
|
|
@@ -42,6 +45,8 @@ public class AcceptanceService {
|
|
|
childHandler(new ChannelInitializer<SocketChannel>() {
|
|
|
@Override
|
|
|
protected void initChannel(SocketChannel ch) throws Exception {
|
|
|
+ ch.pipeline().addLast("idleStateHandler",
|
|
|
+ new IdleStateHandler(10, 0, 0, TimeUnit.MINUTES));
|
|
|
ch.pipeline().addLast(watchServcie);
|
|
|
}
|
|
|
})
|
|
@@ -59,5 +64,4 @@ public class AcceptanceService {
|
|
|
}
|
|
|
}).start();
|
|
|
}
|
|
|
-
|
|
|
}
|