From 157adca76266a80dc641c33dd4ca07ace4c5d9ef Mon Sep 17 00:00:00 2001 From: Dank074 Date: Tue, 13 Oct 2020 01:09:12 -0500 Subject: [PATCH] added ping/pong timeout to pipeline. Updated readme --- README.md | 2 +- .../plugin/nitro/websockets/NetworkChannelInitializer.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 70ba16c..22b7c65 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # NitroWebsockets ## What is NitroWebsockets? ## -NitroWebsockets is a plugin that adds Nitro HTML5 Client compatibility to any hotel running Arcturus MS 2.4.0 and above. +NitroWebsockets is a plugin that adds Nitro HTML5 Client compatibility to any hotel running Arcturus MS 2.5.0 and above. ## How do I configure the plugin? Startup the plugin so it generates the required entries under your `emulator_settings` table. The following fields will be generated: diff --git a/src/main/java/com/krews/plugin/nitro/websockets/NetworkChannelInitializer.java b/src/main/java/com/krews/plugin/nitro/websockets/NetworkChannelInitializer.java index 83843ab..d29021c 100644 --- a/src/main/java/com/krews/plugin/nitro/websockets/NetworkChannelInitializer.java +++ b/src/main/java/com/krews/plugin/nitro/websockets/NetworkChannelInitializer.java @@ -8,6 +8,7 @@ import com.krews.plugin.nitro.websockets.handlers.MessageInterceptorHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.socket.SocketChannel; import io.netty.handler.logging.LoggingHandler; +import io.netty.handler.timeout.IdleStateHandler; public class NetworkChannelInitializer extends ChannelInitializer { @@ -15,6 +16,9 @@ public class NetworkChannelInitializer extends ChannelInitializer public void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast("logger", new LoggingHandler()); + ch.pipeline().addLast("idleStateHandler", new IdleStateHandler(60, 30, 0)); + ch.pipeline().addAfter("idleStateHandler", "idleEventHandler", new IdleTimeoutHandler()); + ch.pipeline().addLast("messageInterceptor", new MessageInterceptorHandler()); // Decoders.