From 59d75721d18325c9870de3db26006d0dafb241d6 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 20 Feb 2021 10:21:32 +0000 Subject: [PATCH] Add JS5 client timeout Signed-off-by: Graham --- .../kotlin/org/openrs2/archive/cache/Js5ChannelInitializer.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelInitializer.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelInitializer.kt index e484cfc3..56bbe380 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelInitializer.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelInitializer.kt @@ -2,6 +2,7 @@ package org.openrs2.archive.cache import io.netty.channel.Channel import io.netty.channel.ChannelInitializer +import io.netty.handler.timeout.ReadTimeoutHandler import org.openrs2.protocol.Protocol import org.openrs2.protocol.Rs2Decoder import org.openrs2.protocol.Rs2Encoder @@ -14,6 +15,7 @@ import org.openrs2.protocol.login.ServerFullCodec public class Js5ChannelInitializer(private val handler: Js5ChannelHandler) : ChannelInitializer() { override fun initChannel(ch: Channel) { ch.pipeline().addLast( + ReadTimeoutHandler(30), Rs2Encoder(Protocol(InitJs5RemoteConnectionCodec)), Rs2Decoder(Protocol(Js5OkCodec, ClientOutOfDateCodec, IpLimitCodec, ServerFullCodec)), handler