As the title says, I'm encountering this error when trying to access a distant database. This is a part of my crash log :
retrofit.RetrofitError: failed to connect to xx.xx.xx.xx/xx.xx.xx.x (port 80) from /xx.xx.xx.xx (port 52908) after 15000ms
Caused by: java.net.SocketTimeoutException: failed to connect to xx.xx.xx.xx/xx.xx.xx.x (port 80) from /xx.xx.xx.xx (port 52908) after 15000ms
The app works fine since I tested it with various devices and the server is up and running.
a workaround would be to increase the timeout
but is there any other way to handle this issue? All posts I read mentioning this, only suggest to set a high timeout
. Or should I just set a use case where this issue occurs and alert the user to check his connection ?
Any advice is much appreciated
Note :
- retrofit version I'm using is : 1.9.0
- OkHttp3 version is 3.0.1