Skip to content

Commit

Permalink
fixup! KTOR-8135 Socket accept not throwing error on socket close on …
Browse files Browse the repository at this point in the history
…native
  • Loading branch information
Thomas-Vos authored and osipxd committed Feb 4, 2025
1 parent afd0952 commit 6b17359
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal class ServerSocketContext(
private class ServerSocketImpl(
override val localAddress: SocketAddress,
override val socketContext: Job,
private val incoming: ReceiveChannel<Socket>,
private val incoming: Channel<Socket>,
private val server: Server
) : ServerSocket {
override suspend fun accept(): Socket = incoming.receive()
Expand All @@ -68,6 +68,7 @@ private class ServerSocketImpl(
}

override fun close() {
incoming.close(IOException("Server socket closed"))
socketContext.cancel("Server socket closed")
}
}

0 comments on commit 6b17359

Please sign in to comment.