Timeout for server request made using “Volley” only on Android not iOS

2,444 views
Skip to first unread message

Mamata Gelanee

unread,
Dec 30, 2015, 12:27:11 AM12/30/15
to Volley Users

n one of my application, I am sending request to server using volley provided by Google.

Problem : Timeout and error object is null on onErrorResponse(VolleyError error)

What i have tried so far :


1) First I got null error object so solved it by using below code :


 @Override
 protected void deliverResponse(String response) {
    super.deliverResponse(response);
 }

 @Override
 public void deliverError(VolleyError error) {
     super.deliverError(error);
     DebugLog.e("deliverResponse", "getNetworkTimeMs : " + error.getNetworkTimeMs());
 }


So far I have got that there is timeout happening when I got error object null.


2) Now Application is for Android and iOS and web but timeout happens only for Android.


Volley log for requests :

BasicNetwork.logSlowRequests: HTTP response for request

Edited Note :

  1. 1. Web services develoed at server end is same for all three instances (Android , Web and iOS). 
  2. 2.Timeout happens when too many users makes requests to the server.
  3. 3. I have set time out to 2 minutes though volley throws timeout in 30 seconds only sometimes.

  4. 4. I have many answers to change server but as it is not possible so any other solution please.

I also like to add that if i can get more information about when timeout can be possible in volley.


References I have been gone through :

Optimizing Volley

httpclient-often-times-out-using-wifi-is-going-fine-with-3g

long_xmlhttprequest_ajax_requests_timeout_on_android


I have also set retry plolicy as below:


request.setRetryPolicy(new DefaultRetryPolicy(DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 48,
                0, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));

And also i do not want to retry if connection timeout.

How can i make efficient service call that can solve problem for timeout.


Any help will be appriciated.


Thanks.

vasa...@weetechsolution.com

unread,
Feb 18, 2019, 6:03:44 AM2/18/19
to Volley Users
I am getting same issue as yours, its not working in android but working in ios. Have you got any solution for that? please help me if you have found any solution.
Thank you.
Reply all
Reply to author
Forward
0 new messages