CamilleBC
10/02/2018, 8:50 AMgildor
10/02/2018, 8:52 AMI managed to communicate through the socket using coroutinesDo you use sockets for HTTP requests?? Sounds like a super low level solution
CamilleBC
10/02/2018, 8:54 AMgildor
10/02/2018, 8:57 AMCamilleBC
10/02/2018, 9:01 AMgildor
10/02/2018, 9:03 AMwithContext(<http://Dispatchers.IO|Dispatchers.IO>)
, this will allow to use it without main thread blocking:
fun loadSomething(url: URL) = withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
url.openConnection().getInputStream().readBytes()
}
CamilleBC
10/02/2018, 9:04 AMDispatchers.Main
and Dispatchers.Default
, not about this one. Thanks! I'm still learning how to get info from the docs, I'm pretty bad at that đ˘gildor
10/02/2018, 9:06 AMgildor
10/02/2018, 9:07 AMCamilleBC
10/02/2018, 9:10 AMgildor
10/02/2018, 9:39 AMelizarov
10/02/2018, 9:44 AM