mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-04 04:37:59 +08:00
HttpGlobalConfig timeout: 增加说明
This commit is contained in:
parent
34e830725c
commit
fe151787a0
@ -20,6 +20,14 @@ import java.net.HttpURLConnection;
|
|||||||
public class HttpGlobalConfig implements Serializable {
|
public class HttpGlobalConfig implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* -1: 含义,永不超时。
|
||||||
|
* 如果:设置timeout = 3s(3000 ms), 那一次请求最大超时:就是:6s
|
||||||
|
* 官方含义:timeout of zero is interpreted as an infinite timeout. (0的超时被解释为无限超时。)
|
||||||
|
* 这里实际项目一定要进行修改,防止把系统拖死.
|
||||||
|
* 底层调用:{@link HttpURLConnection#setReadTimeout(int)} 同时设置: 读取超时
|
||||||
|
* 底层调用:{@link HttpURLConnection#setConnectTimeout(int)} 同时设置: 连接超时
|
||||||
|
*/
|
||||||
private static int timeout = -1;
|
private static int timeout = -1;
|
||||||
private static boolean isAllowPatch = false;
|
private static boolean isAllowPatch = false;
|
||||||
private static String boundary = "--------------------Hutool_" + RandomUtil.randomString(16);
|
private static String boundary = "--------------------Hutool_" + RandomUtil.randomString(16);
|
||||||
|
Loading…
Reference in New Issue
Block a user