Hello, Using TCP keepalive wont help you with default OS settings, it would not start to send them in the first 20 idle minutes. You could configure the host to do it quicker but its not something you can portably configure from Java. Besides not all statefull filters honor it as beeing non-idle. An alternative would be to send 0-byte HTTP (content transfer) chunks from the server.
Gruss Bernd -- http://bernd.eckenfels.net -----Original Message----- From: Oleg Kalnichevski <ol...@apache.org> To: HttpClient User Discussion <httpclient-users@hc.apache.org> Sent: Mi., 11 Mai 2016 18:46 Subject: Re: Apache HttpClient TCP Keep-Alive (socket keep-alive) On Wed, 2016-05-11 at 15:52 +0100, Baratali Izmailov wrote: > Hello, > > I have http request that takes too much time to be processed by the server > (about 5 minutes). Because connection becomes idle for 5 minutes, proxy > server shutdowns the connection. I'm trying to use TCP Keep-Alive in Apache > DefaultHttpClient to make connection be alive for a long time (Not confuse > TCP Keep-Alive with HTTP Keep-Alive that simply doesn't closes connection > after response is sent). > > Apache http core has following parameter SO_KEEPALIVE: > http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/params/CoreConnectionPNames.html#SO_KEEPALIVE. > However, due to DefaultHttpClient javadocs I can't customize client's > behavior with that parameter: > https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/client/DefaultHttpClient.html > . > > Do you know how to make DefaultHttpClient use TCP Keep-Alive strategy? > > > Thanks, > > Baratali. Baratali What version of HttpClient are you using? It looks like something fairly old. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org