diff --git a/mirai-core/src/commonMain/kotlin/network/handler/NetworkHandler.kt b/mirai-core/src/commonMain/kotlin/network/handler/NetworkHandler.kt index adf3cb0d1..d04a69368 100644 --- a/mirai-core/src/commonMain/kotlin/network/handler/NetworkHandler.kt +++ b/mirai-core/src/commonMain/kotlin/network/handler/NetworkHandler.kt @@ -72,15 +72,6 @@ internal interface NetworkHandler { */ OK, - /** - * No Internet Connection available or for any other reasons - * but it is possible to establish a connection again(switching state to [CONNECTING]). - * - * At this state [resumeConnection] turns the handle to [CONNECTING]. - * [sendAndExpect] throws [IllegalStateException] - */ - CONNECTION_LOST, - /** * Cannot resume anymore. Both [resumeConnection] and [sendAndExpect] throw a [CancellationException]. * diff --git a/mirai-core/src/commonMain/kotlin/network/handler/selector/AbstractKeepAliveNetworkHandlerSelector.kt b/mirai-core/src/commonMain/kotlin/network/handler/selector/AbstractKeepAliveNetworkHandlerSelector.kt index 972620f29..25d22842b 100644 --- a/mirai-core/src/commonMain/kotlin/network/handler/selector/AbstractKeepAliveNetworkHandlerSelector.kt +++ b/mirai-core/src/commonMain/kotlin/network/handler/selector/AbstractKeepAliveNetworkHandlerSelector.kt @@ -47,7 +47,6 @@ internal abstract class AbstractKeepAliveNetworkHandlerSelector { current.resumeConnection() diff --git a/mirai-core/src/commonMain/kotlin/network/impl/netty/NettyNetworkHandler.kt b/mirai-core/src/commonMain/kotlin/network/impl/netty/NettyNetworkHandler.kt index 141eea41e..dbe11e117 100644 --- a/mirai-core/src/commonMain/kotlin/network/impl/netty/NettyNetworkHandler.kt +++ b/mirai-core/src/commonMain/kotlin/network/impl/netty/NettyNetworkHandler.kt @@ -317,24 +317,6 @@ internal class NettyNetworkHandler( override fun toString(): String = "StateOK" } - private inner class StateConnectionLost( - private val cause: Throwable? - ) : NettyState(State.CONNECTION_LOST) { - override fun getCause(): Throwable? = cause - - override suspend fun sendPacketImpl(packet: OutgoingPacket) { - throw IllegalStateException( - "Internal error: connection is lost so cannot send packet. Call resumeConnection first.", - cause - ) - } - - override suspend fun resumeConnection0() { - setState { StateConnecting(ExceptionCollector(cause)) } - .resumeConnection() - } // noop - } - private inner class StateClosed( val exception: Throwable? ) : NettyState(State.CLOSED) {