Has somebody used TCP or UDP sockets with Kotlin C...
# coroutines
a
Has somebody used TCP or UDP sockets with Kotlin Coroutines? AFAIK even if you wrap them to be coroutine friendly, they still block the underlying threads and I can't see any advantage over classical Thread Pool Executor.
s
Yes, they would block. And that is fine. Wrap blocking code in such a thread-pool-executor dispatcher, like Dispatchers.IO.
a
Yes, that's what I've done so far. Does it make a substantial difference to use DatagramChannel (java.nio) over DatagramSocket?
113 Views