From 206706936fe3d37c54441e99030a0b2d85414c19 Mon Sep 17 00:00:00 2001 From: looly Date: Wed, 5 Jan 2022 10:54:09 +0800 Subject: [PATCH] add comment --- .../src/main/java/cn/hutool/http/HttpGlobalConfig.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hutool-http/src/main/java/cn/hutool/http/HttpGlobalConfig.java b/hutool-http/src/main/java/cn/hutool/http/HttpGlobalConfig.java index 119729cb4..918085592 100755 --- a/hutool-http/src/main/java/cn/hutool/http/HttpGlobalConfig.java +++ b/hutool-http/src/main/java/cn/hutool/http/HttpGlobalConfig.java @@ -43,7 +43,13 @@ public class HttpGlobalConfig implements Serializable { } /** - * 设置默认的连接和读取超时时长 + * 设置默认的连接和读取超时时长
+ * -1: 含义,永不超时。
+ * 如果:设置timeout = 3s(3000 ms), 那一次请求最大超时:就是:6s
+ * 官方含义:timeout of zero is interpreted as an infinite timeout. (0的超时被解释为无限超时。)
+ * 这里实际项目一定要进行修改,防止把系统拖死.
+ * 底层调用:{@link HttpURLConnection#setReadTimeout(int)} 同时设置: 读取超时
+ * 底层调用:{@link HttpURLConnection#setConnectTimeout(int)} 同时设置: 连接超时 * * @param customTimeout 超时时长 */