RequestConfig represents request level parameters. Socket and connect
timeout values, if non-zero, override those used by default.


Thread below was specific to HttpAsync client but for Sync client also it 
should stand true. 
http://mail-archives.apache.org/mod_mbox/hc-httpclient-users/201310.mbox/%3C1382089744.18812.32.camel@ubuntu%3E

Thanks,
Jaikit


On Sunday, September 21, 2014 4:05 AM, "Shih-liang, Chang" 
<[email protected]> wrote:



Hi

I'm using the HttpClient 4.4. 
I am creating HttpClient instance using custom settings. Is the following 
configuration the same effect? or whats the different between them? I can’t 
find it in javadoc.
A.
SocketConfig socketConfig = SocketConfig.custom()
    .setSoTimeout(DEFAULT_SOCKET_TIMEOUT)
    .build();
CloseableHttpClient httpClient = HttpClients.custom()
     .setDefaultSocketConfig(socketConfig)
     .build();


B.


RequestConfig requestConfig = RequestConfig.custom()
    .setSocketTimeout(DEFAULT_SOCKET_TIMEOUT)
    .build();
CloseableHttpClient httpClient = HttpClients.custom()
     .setDefaultRequestConfig(requestConfig)
     .build();


Thanks in advance.
BR,
Atkins

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to