Open robinskumar73 opened 8 years ago
Hi @robinskumar73! I had the same problem.
The cleanest way I found to increase the timeout of the socket was to extend the com.strongloop.android.loopback.RestAdapter
class and add the method:
public void setTimeout(int timeoutMillis) {
getClient().setTimeout(timeoutMillis);
}
What i use is something like:
public class MyRestAdapter extends com.strongloop.android.loopback.RestAdapter{
public static final int TIMEOUT = 30000;
public MyRestAdapter(Context context, String url) {
super(context, url);
setTimeout(TIMEOUT); // Default to the desired timeout
}
// And the method above
}
And finally use this child class in place of the old RestAdapter
class.
I am facing socket timeout exception whenever I am trying to upload a little large image or some file through android. How can I increase timeout to prevent socket timeout exception?