We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi I reported an issue to ktor framework, which is in fact an known bug in kotlinx.coroutines, so I paste the code here too.
ktor
kotlinx.coroutines
import io.ktor.network.sockets.aSocket import io.ktor.network.sockets.openReadChannel import io.ktor.network.sockets.openWriteChannel import kotlinx.coroutines.experimental.async import kotlinx.coroutines.experimental.launch import kotlinx.coroutines.experimental.runBlocking import java.net.InetSocketAddress fun main(args: Array<String>) { async { val server = aSocket().tcp().bind(InetSocketAddress(12000)) while (true) { println("accept") val socket = server.accept() launch { val wc = socket.openWriteChannel(autoFlush = true) while (true) { wc.writeByte(1) wc.writeInt(1) } } } } Thread.sleep(1000) runBlocking { aSocket().tcp().connect(InetSocketAddress("localhost", 12000)).use { socket -> val rc = socket.openReadChannel() while (true) { check(rc.readByte() == 1.toByte()) { "byte" } check(rc.readInt() == 1) { "int" } } } } }
The text was updated successfully, but these errors were encountered:
a432a82
cy6erGn0m
No branches or pull requests
Hi
I reported an issue to
ktor
framework, which is in fact an known bug inkotlinx.coroutines
, so I paste the code here too.The text was updated successfully, but these errors were encountered: