diff --git a/test/dorkboxTest/network/DisconnectReconnectTest.kt b/test/dorkboxTest/network/DisconnectReconnectTest.kt index a9854024..6ad2a5fc 100644 --- a/test/dorkboxTest/network/DisconnectReconnectTest.kt +++ b/test/dorkboxTest/network/DisconnectReconnectTest.kt @@ -5,16 +5,11 @@ import dorkbox.network.Server import dorkbox.network.aeron.AeronDriver import dorkbox.network.connection.Connection import kotlinx.atomicfu.atomic -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.async import kotlinx.coroutines.delay -import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import org.junit.Assert import org.junit.Test import java.io.IOException -import kotlin.time.Duration.Companion.seconds class DisconnectReconnectTest : BaseTest() { private val reconnectCount = atomic(0) @@ -128,55 +123,6 @@ class DisconnectReconnectTest : BaseTest() { Assert.assertEquals(4, reconnectCount.value) } - @Test - fun multiConnectClient() { - // clients first, so they try to connect to the server at (roughly) the same time - val config = clientConfig() - - val client1: Client = Client(config) - val client2: Client = Client(config) - - addEndPoint(client1) - addEndPoint(client2) - client1.onDisconnect { - logger.error("Disconnected 1!") - } - client2.onDisconnect { - logger.error("Disconnected 2!") - } - - GlobalScope.launch { - client1.connect(LOCALHOST) - } - - GlobalScope.launch { - client2.connect(LOCALHOST) - } - - println("Starting server...") - - run { - val configuration = serverConfig() - - val server: Server = Server(configuration) - addEndPoint(server) - server.bind() - - server.onConnect { - logger.error("Disconnecting after 10 seconds.") - delay(10.seconds) - - logger.error("Disconnecting....") - close() - } - } - - waitForThreads() - - System.err.println("Connection count (after reconnecting) is: " + reconnectCount.value) - Assert.assertEquals(4, reconnectCount.value) - } - interface CloseIface { suspend fun close() }