I am building a library using kmm(iOS+Android). I ...
# multiplatform
v
I am building a library using kmm(iOS+Android). I keep getting a
sockettimeoutexception
when I make a call to an API using ktor/okhttp. The exception can be handled and I will also fix the API at some point. The question here is how do I change the timeout interval? The exception is generated after 10 seconds. I have tried a few things which I can get my hands on, but nothing worked. I would really appreciate any help.
k
when you build the client you can set a timeout
private fun buildClient(): HttpClient {
return HttpClient(CIO) *{*
install(HttpTimeout) *{*
requestTimeoutMillis = params.httpClientTimeout
}
}
}
v
I am using okhttp, not CIO
Ok got the solution. I was just configuring
connectTimeout
, I need to configure all three, read/write/connect
Thanks Killian