Default timeout for HttpComponent Client

后端 未结 5 657
我寻月下人不归
我寻月下人不归 2021-02-12 17:57

I can\'t find any documentation on the default httpParams for httpclient 4.1 ?

What\'s the default socket timeout when I do a GET ?

5条回答
  •  逝去的感伤
    2021-02-12 18:49

    The accepted answer is not applicable for newer versions of HttpClient. Versions 4.3.X and above use the system default which is usually 60 secs.

    Taken from 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
    

提交回复
热议问题