Apache HttpClient 4.3 SocketConfig.getSoTimeout() vs RequestConfig.getSocketTimeout()

StackOverflow https://stackoverflow.com/questions/22716086

  •  23-06-2023
  •  | 
  •  

문제

When building a CloseableHttpClient in Apache HttpClient 4.3, I can use

SocketConfig.custom().setSoTimeout(soTimeout).build()

and send it to the setDefaultSocketConfig() method of my connection manager.

I can also use

RequestConfig.custom().setSocketTimeout(socketTimeout).build()

and send it to the setDefaultRequestConfig() method of my http client builder.

Will these have the same end effect or different end effects?

도움이 되었습니까?

해결책

Socket timeout in SocketConfig represents the default value applied to newly created connections. This value can be overwritten for individual requests by setting a non zero value of socket timeout in RequestConfig.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top