parameter (https://api.ktor.io/ktor-network/ktor-network-tls/io.ktor.network.tls/tls.html) -- what is the intended usage pattern for this? When the TLS handshake fails the exception is propagating up my coroutine tree as unhandled exceptions, even though I catch it in the child coroutine. Only passing an independent scope to
socket.tls()
appears to prevent this propagation -- is that the recommended approach?
rocketraman
01/18/2024, 2:13 AM
For now, I've created a separate scope, which is not a child of the scope that starts the socket. I cancel this scope when the socket is closed.
rocketraman
01/22/2024, 3:41 PM
@Aleksei Tirman [JB] Any thoughts here?
e
e5l
01/23/2024, 8:32 AM
This
coroutineContext
will receive errors when there are no other handlers to process it (for instance in case of shutdown). You also can use it for the cancellation.
You rarely can use it as a child cause usually socket coroutine is not decomposition of your parent task
r
rocketraman
01/23/2024, 3:19 PM
Thank you @e5l. That makes sense. It would be useful if the docs for the tls method would discuss this.