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

后端 未结 5 1372
借酒劲吻你
借酒劲吻你 2020-12-16 18:04

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

Problem : Timeout and error object is null o

5条回答
  •  执笔经年
    2020-12-16 18:26

    As i have tried to get solution of this issue for about two months, I did not get any perfect solution. Though I analyze some facts as below :

    1. You can upgrade your server's performance
    2. I have tried making web-service request using HttpURLConnection but still getting same issue over there.

    So I think this issue is not specific from volley, but you getting this issue then i would suggest to increase server performance with customizing below RetryPolicy:

    int x=2;// retry count
    request.setRetryPolicy(new DefaultRetryPolicy(DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 48,
                        x, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
    

    Hope it will help.

    Suggestions are always welcome :)

    Please comment below if you found more proper solution.

    Thanks.!

提交回复
热议问题