From f84bcdbec57e417671532596aa21d61d24b7fc76 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 17 Aug 2020 16:48:16 +0200 Subject: [PATCH] Added close for rmi support, removed actor --- src/dorkbox/network/connection/EndPoint.kt | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/dorkbox/network/connection/EndPoint.kt b/src/dorkbox/network/connection/EndPoint.kt index 244d7b2b..7dd07a74 100644 --- a/src/dorkbox/network/connection/EndPoint.kt +++ b/src/dorkbox/network/connection/EndPoint.kt @@ -38,7 +38,6 @@ import kotlinx.atomicfu.atomic import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.cancel -import kotlinx.coroutines.channels.actor import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import mu.KLogger @@ -69,18 +68,6 @@ internal constructor(val type: Class<*>, internal val config: Configuration) : A protected constructor(config: ServerConfiguration) : this(Server::class.java, config) - fun CoroutineScope.connectionActor() = actor> { - var counter = 0 - - for (message in channel) { - when(message) { - is ActorMessage.AddConnection -> println("add") - is ActorMessage.RemoveConnection -> println("del") -// is ActorMessage.GetValue -> message.deferred.complete(counter) - } - } - } - companion object { /** * Identifier for invalid sessions. This must be < RESERVED_SESSION_ID_LOW @@ -609,6 +596,8 @@ internal constructor(val type: Class<*>, internal val config: Configuration) : A autoClosableObjects.clear() runBlocking { + rmiGlobalSupport.close() + // don't need anything fast or fancy here, because this method will only be called once connections.forEach { it.close()