From 6b17359592cb58bcec1094cc81c7bb2af2e3708d Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 31 Jan 2025 03:13:36 +0100 Subject: [PATCH] fixup! KTOR-8135 Socket accept not throwing error on socket close on native --- .../src/io/ktor/network/sockets/ServerSocketContext.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ktor-network/jsAndWasmShared/src/io/ktor/network/sockets/ServerSocketContext.kt b/ktor-network/jsAndWasmShared/src/io/ktor/network/sockets/ServerSocketContext.kt index f14801e28e8..1d9284e0311 100644 --- a/ktor-network/jsAndWasmShared/src/io/ktor/network/sockets/ServerSocketContext.kt +++ b/ktor-network/jsAndWasmShared/src/io/ktor/network/sockets/ServerSocketContext.kt @@ -55,7 +55,7 @@ internal class ServerSocketContext( private class ServerSocketImpl( override val localAddress: SocketAddress, override val socketContext: Job, - private val incoming: ReceiveChannel, + private val incoming: Channel, private val server: Server ) : ServerSocket { override suspend fun accept(): Socket = incoming.receive() @@ -68,6 +68,7 @@ private class ServerSocketImpl( } override fun close() { + incoming.close(IOException("Server socket closed")) socketContext.cancel("Server socket closed") } }