Why would a “java.net.ConnectException: Connection timed out” exception occur when URL is up?

后端 未结 10 1771
傲寒
傲寒 2020-11-29 18:42

I\'m getting a ConnectException: Connection timed out with some frequency from my code. The URL I am trying to hit is up. The same code works for some users,

10条回答
  •  被撕碎了的回忆
    2020-11-29 19:14

    The error message says it all: your connection timed out. This means your request did not get a response within some (default) timeframe. The reasons that no response was received is likely to be one of:

    a) The IP/domain or port is incorrect

    b) The IP/domain or port (i.e service) is down

    c) The IP/domain is taking longer than your default timeout to respond

    d) You have a firewall that is blocking requests or responses on whatever port you are using

    e) You have a firewall that is blocking requests to that particular host

    f) Your internet access is down

    g) Your live-server is down i.e in case of "rest-API call".

    Note that firewalls and port or IP blocking may be in place by your ISP

提交回复
热议问题