Vladimir
03/11/2021, 3:09 PMjava.util.concurrent.CancellationException: LinkedListChannel was cancelled
(full traceback at https://pastebin.com/GU3a8HMD )
Loop looks like this:
try {
for (frame in websocketSession.incoming) {
frame as? Frame.Text ?: continue
val content = frame.readText()
ctx.sessionScope.launch {
handleMessage(ctx, content)
}
}
} catch (e: ClosedReceiveChannelException) {
// socket is closed from client and handled by ktor
} catch (e: Throwable) {
// error occured (abrupt connection termination or other websocket internal error)
logger.error("Unhandled websocket session error: ${e.message}", e)
}
Ktor 1.5.2, coroutines 1.4.2, netty 4.1.54.FinalVladimir
03/11/2021, 3:36 PM