CamilleBC
10/02/2018, 12:50 PMCaused by: java.io.IOException: unexpected end of stream on com.android.okhttp.Address@...
.
I am guessing that because of the multiple requests to HttpUrlConnection, opening and closing the input/output streams, at some point I am accessing a stream when the app has not closed it, or it is closing it when I am in the middle of accessing it. I am running the function as a runBlocking (<http://Dispatchers.IO|Dispatchers.IO>) { // BLOCK that opens/closes the stream then closes the UrlConnection // }
though.
What is the best way to prevent that? Will using actors to dispatch the requests change anything? Any idea what I could do to prevent that? I don't really know if there is a Kotlin/Android way which could help me there.