Commit 732c46ee authored by Mygod's avatar Mygod

Fix CancelledKeyException

parent 1def9e69
......@@ -62,7 +62,7 @@ class ChannelMonitor : Thread("ChannelMonitor"), AutoCloseable {
suspend fun wait(channel: SelectableChannel, ops: Int) = suspendCancellableCoroutine<Unit> { cont ->
register(channel, ops) {
it.interestOps(0) // stop listening
if (it.isValid) it.interestOps(0) // stop listening
cont.resume(Unit)
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment