rocketraman
12/18/2018, 6:27 PMjava.util.concurrent.CancellationException: Channel has been cancelled
from the ktor client, using CIO, with the same code that used to work with 1.0.0. Anyone else experienced this?e5l
12/18/2018, 6:29 PMrocketraman
12/18/2018, 6:37 PMrocketraman
12/18/2018, 6:48 PMfun main(args: Array<String>) = runBlocking {
val client = HttpClient(CIO.config { })
suspend fun <T> download(block: suspend (ByteReadChannel) -> T): T? {
val byteReadChannel: ByteReadChannel = client.call( "<https://www.google.com>").use {
it.receive()
}
return block(byteReadChannel)
}
download {
it.copyTo(System.out)
}
println("\nDone!!")
}
rocketraman
12/18/2018, 6:53 PMblock
inside the call.use
works, but is this the intended behavior?e5l
12/18/2018, 7:03 PMcall
object, it releases the response data and connection.rocketraman
12/18/2018, 10:38 PMe5l
12/19/2018, 4:01 AM