Reputation: 19582
I am trying to access a remote service via Volley and I end up in the on error response function with the error:
02-26 10:29:53.491: D/MyApp(1592): java.net.SocketTimeoutException: failed to connect to 10.10.201.10 (port 443) after 5000ms
I can access this IP from my browser and I can see the interface fine. Why do I get this from eclipse/volley? How can I debug this?
Upvotes: 0
Views: 547
Reputation: 562
Does your server return any kind of data, SocketTimeoutException occurr when there are blocking issues in read() or accept(), ie. if server doesn't return any data in defined timeout interval this exception will rise. It also could be a network problem, delay of some kind.
Upvotes: 0
Reputation: 2404
setTimeout(int millis)
. There are not further things you can do unless you dig into the service codes.Upvotes: 1
Reputation: 12536
Did you set socket timeout value as 5000ms? If so, the request is failing since it is taking more than 5000ms. Try increasing the time out value in your custom Request
class
public static final int MY_SOCKET_TIMEOUT_MS = 30000;
@Override
public Request<?> setRetryPolicy(RetryPolicy retryPolicy) {
retryPolicy = new DefaultRetryPolicy(MY_SOCKET_TIMEOUT_MS,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES , DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
return super.setRetryPolicy(retryPolicy);
}
Upvotes: 1