From b7b4ec756666e413e032b018101dd90c5cd7721a Mon Sep 17 00:00:00 2001 From: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> Date: Fri, 21 Aug 2020 10:50:02 -0500 Subject: [PATCH] Simplify netty --- src/main/kotlin/mdnet/base/netty/ApplicationNetty.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/mdnet/base/netty/ApplicationNetty.kt b/src/main/kotlin/mdnet/base/netty/ApplicationNetty.kt index a51c83c..347cb76 100644 --- a/src/main/kotlin/mdnet/base/netty/ApplicationNetty.kt +++ b/src/main/kotlin/mdnet/base/netty/ApplicationNetty.kt @@ -42,7 +42,6 @@ import java.net.SocketException import java.security.PrivateKey import java.security.cert.CertificateFactory import java.security.cert.X509Certificate -import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicReference import javax.net.ssl.SSLException import mdnet.base.Constants @@ -127,9 +126,9 @@ class Netty(private val tls: TlsCert, private val serverSettings: ServerSettings } override fun stop() = apply { - masterGroup.shutdownGracefully(1, 15, TimeUnit.SECONDS).sync() - workerGroup.shutdownGracefully(1, 15, TimeUnit.SECONDS).sync() - closeFuture.sync() + closeFuture.cancel(false) + workerGroup.shutdownGracefully() + masterGroup.shutdownGracefully() } override fun port(): Int = if (serverSettings.clientPort > 0) serverSettings.clientPort else address.port