URLConnection.setConnectTimeout() does not work when DNS is unreachable

后端 未结 2 1493
渐次进展
渐次进展 2021-01-28 07:17

Here is my code :

URL u = new URL(\"http://www.google.com\");
        URLConnection conn = u.openConnection();
        conn.setConnectTimeout(3000);
        conn         


        
2条回答
  •  [愿得一人]
    2021-01-28 08:12

    Some non-standard implmentation of this method may ignore the specified timeout. See this setConnectTimeout

提交回复
热议问题