I have a simple API request which I make by using Retrofit/OkHttp.
private fun getNext(
nextId: Long
): Observable<NextData> =
userRepo.getNext(nextId)
.map { it.toDomainObject() }
The API replies 200, OK
and it replies fast (definitely less than 3 seconds). However, this call sometimes throws
java.net.SocketTimeoutException: timeout
I also configured my OkHttpClient
to have callTimeout(15, TimeUnit.SECONDS)
. I really do not understand why I have such an exception. Any ideas about solving this problem would be appreciated.