Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 865
Robert Tupelo-Schneck Avatar asked Mar 28 '14 14:03

Robert Tupelo-Schneck


1 Answers

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.

like image 74
ok2c Avatar answered Sep 20 '22 12:09

ok2c