[
https://issues.apache.org/jira/browse/HTTPCLIENT-2384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18010191#comment-18010191
]
Igor Mukhin commented on HTTPCLIENT-2384:
-----------------------------------------
In general, I would say that the method connect() in the class
DefaultHttpClientConnectionOperator should include the following lines which
configuring the socket:
{code:java}
if (socketConfig.getTcpKeepIdle() > 0) {
SocketSupport.setOption(sock, SocketSupport.TCP_KEEPIDLE,
socketConfig.getTcpKeepIdle());
}
if (socketConfig.getTcpKeepInterval() > 0) {
SocketSupport.setOption(sock, SocketSupport.TCP_KEEPINTERVAL,
socketConfig.getTcpKeepInterval());
}
if (socketConfig.getTcpKeepCount() > 0) {
SocketSupport.setOption(sock, SocketSupport.TCP_KEEPCOUNT,
socketConfig.getTcpKeepCount());
}
{code}
> Socket options related to TcpKeepAlive are ignored
> --------------------------------------------------
>
> Key: HTTPCLIENT-2384
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2384
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient (async), HttpClient (classic)
> Affects Versions: 5.5
> Reporter: Igor Mukhin
> Priority: Major
>
> SocketConfig has properties to set up TcpKeepAlive mechanism. Those are:
> {code}
> SocketConfig.tcpKeepIdle
> SocketConfig.tcpKeepInterval
> SocketConfig.tcpKeepCount
> {code}
> These properties are ignored while configuring a Socket in
> DefaultHttpClientConnectionOperator.connect(...). Some standard options are
> configured but not the tcpKeepAlive related stuff.
> We bumped into the issue after migrating from 4.5.x. In 4.5 we were able to
> configure a socket factory that done the socket configuration we needed.
> After migration, we were glad to see that tcpKeepAlive could be configured in
> SocketConfig. But it turned out the properties are ignored.
> For now, we are using a workaround by creating
> PoolingHttpClientConnectionManager which is supplied with the custom
> configured DefaultHttpClientConnectionOperator which is configured with a
> custom DetachedSocketFactory that configures tcpKeepAlive. Obviously this is
> not the intended way of setting it up.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]