diff --git a/src/main/kotlin/com/viaversion/aas/handler/autoprotocol/ProtocolDetector.kt b/src/main/kotlin/com/viaversion/aas/handler/autoprotocol/ProtocolDetector.kt index 3f3d262..ec12ce5 100644 --- a/src/main/kotlin/com/viaversion/aas/handler/autoprotocol/ProtocolDetector.kt +++ b/src/main/kotlin/com/viaversion/aas/handler/autoprotocol/ProtocolDetector.kt @@ -24,16 +24,17 @@ import io.netty.channel.ChannelOption import io.netty.handler.timeout.ReadTimeoutHandler import io.netty.resolver.NoopAddressResolverGroup import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Job +import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.launch import java.net.InetSocketAddress import java.util.concurrent.CompletableFuture import java.util.concurrent.TimeUnit object ProtocolDetector { + val coroutineScope = CoroutineScope(SupervisorJob()) private val loader = CacheLoader.from> { address -> val future = CompletableFuture() - CoroutineScope(Job()).launch { + coroutineScope.launch { try { val proxyUri = VIAaaSConfig.backendProxy val proxySocket = if (proxyUri == null) null else {