我正在打开一个 url 并得到一个 SocketTimeoutException:
long now = System.currentTimeMillis();
try {
URL url = new URL("https://example.com");
InputStreamReader is = new InputStreamReader(url.openStream());
..
}
catch (SocketTimeoutException ex) {
long diff = System.currentTimeMillis() - now;
System.err.println("Timeout!: " + diff + "ms"); // ~4 seconds
}
java.net.SocketTimeoutException: Timeout while fetching URL: https://example.com
at com.google.appengine.api.urlfetch.URLFetchServiceImpl.convertApplicationException(URLFetchServiceImpl.java:142)
但经过的时间只有4秒。我的这段代码自 2 月以来就没有改变,与它所访问的“example.com”网址相同(这也在我的控制之下)。
应用引擎团队是否可以在较低级别进行更改以减少引发超时异常之前的时间长度?
谢谢