Volley Timeout Error

前端 未结 13 1051
清歌不尽
清歌不尽 2020-12-01 14:31

I am trying to hit a rest service using Volley.

public class AuthFunctions {
    private static final String LOGIN_URL = \"http://10.0.2.2:8080/stewayservic         


        
相关标签:
13条回答
  • 2020-12-01 14:46

    Check out that your IPv4 Address in the URL is correct and has not been changed.

    0 讨论(0)
  • 2020-12-01 14:49

    5 year old question is tough to deal with today's problem.

    Volley will no more accept http and ip address. Will accept only https with fqdn only.

    0 讨论(0)
  • 2020-12-01 14:55

    This worked for me:

    request.setRetryPolicy(new RetryPolicy() {
                @Override
                public int getCurrentTimeout() {
                    return 50000;
                }
    
                @Override
                public int getCurrentRetryCount() {
                    return 50000;
                }
    
                @Override
                public void retry(VolleyError error) throws VolleyError {
    
                }
            });
    

    You can change that time.

    0 讨论(0)
  • 2020-12-01 14:55

    Add the following after your error listener

    myRequest.setRetryPolicy(new DefaultRetryPolicy(
        MY_SOCKET_TIMEOUT_MS, 
        DefaultRetryPolicy.DEFAULT_MAX_RETRIES, 
        DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
    
    0 讨论(0)
  • 2020-12-01 14:56
    com.android.volley.TimeoutError
    

    In 75% cases this error is occured due to connectivity issue '

    if you are testing on localhost or local server

    Check firewall is off

    0 讨论(0)
  • 2020-12-01 14:58

    On Macbook I was running a Django application written in python3.X.
    I had to do the following.

    1. Go to system settings
    2. Go to Security & Privacy
    3. Select the firewall tab and click on the firewall options
    4. Allow incoming connection for python 3.7

    0 讨论(0)
提交回复
热议问题