HttpComponent 客户端的默认超时
2022-09-01 21:45:15
我找不到有关 httpclient 4.1 的默认 httpParams 的任何文档?
执行 GET 时的默认套接字超时是什么?
我找不到有关 httpclient 4.1 的默认 httpParams 的任何文档?
执行 GET 时的默认套接字超时是什么?
接受的答案不适用于较新版本的 HttpClient。版本4.3.X及更高版本使用系统默认值,通常为60秒。
取自HttpClient javadoc。
public int getSocketTimeout()
Defines the socket timeout (SO_TIMEOUT) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets).
A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default).
Default: -1