Commit 96840933 authored by 张永's avatar 张永

设置超时时间

parent 0ff33cc4
...@@ -76,7 +76,7 @@ public class HttpUtil { ...@@ -76,7 +76,7 @@ public class HttpUtil {
if (requestUrl.startsWith("https")) { if (requestUrl.startsWith("https")) {
((HttpsURLConnection) connection).setSSLSocketFactory(getDefaultSSLContext().getSocketFactory()); ((HttpsURLConnection) connection).setSSLSocketFactory(getDefaultSSLContext().getSocketFactory());
} }
// 设置连接主机超时(30s) // 设置连接主机超时(30s)
connection.setConnectTimeout(30 * 1000); connection.setConnectTimeout(30 * 1000);
// 设置从主机读取数据超时(3min) // 设置从主机读取数据超时(3min)
connection.setReadTimeout(180 * 1000); connection.setReadTimeout(180 * 1000);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment