Re: Apache HttpClient TCP Keep-Alive (socket keep-alive)

2016-05-19 Thread Baratali Izmailov
> How do you know the keepalive packets have not been sent? Did you run a
tcpdump?
I used Wireshark with "tcp.analysis.keep_alive ||
tcp.analysis.keep_alive_ack" filter to monitor connection between client
and server.

> The socket API (java and apache) traditionally does not support to
configure the keepalive times, they only allow to turn it on.
Yes. As I know the only way to set those timeouts is configuring Linux
parameters. By default keep-alive timeout is 2 hours which is too long :)
Some explanations:
http://stackoverflow.com/questions/1480236/does-a-tcp-socket-connection-have-a-keep-alive/33927447#33927447

Thanks,
Baratali Izmailov.

On 18 May 2016 at 20:19, <e...@zusammenkunft.net> wrote:

> How do you know the keepalive packets have not been sent? Did you run a
> tcpdump?
>
> The socket API (java and apache) traditionally does not support to
> configure the keepalive times, they only allow to turn it on.
>
> BTW: still think tcp keepalives are not what you want to rely on and might
> not help to keep a connection open if an intermediate wants to be an
> annoyance.
>
> Greetings
> Bernd
>
> --
> http://bernd.eckenfels.net
>
> -Original Message-
> From: Baratali Izmailov <baratal...@gmail.com>
> To: HttpClient User Discussion <httpclient-users@hc.apache.org>
> Sent: Mi., 18 Mai 2016 12:37
> Subject: Re: Apache HttpClient TCP Keep-Alive (socket keep-alive)
>
> Thank you. I updated Apache HttpClient version as you described. However,
> it didn't help, TCP KeepAlive packets were not sent between client and
> server.
> If correctly understand, the problem is that I cannot edit TCP KeepAlive
> timouts in HttpClient or even in Apache httpd server. It works only if I
> set timeouts on OS level (in Linux):
> sudo sysctl -w net.ipv4.tcp_keepalive_time=60
> sudo sysctl -w net.ipv4.tcp_keepalive_intvl=60
> sudo sysctl -w net.ipv4.tcp_keepalive_probes=10
>
> With such configs the server sends TCP KeepAlive packets every 60 seconds.
>
> Thanks,
> Baratali Izmailov.
>
> On 12 May 2016 at 15:53, Oleg Kalnichevski <ol...@apache.org> wrote:
>
> > On Thu, 2016-05-12 at 13:46 +0100, Baratali Izmailov wrote:
> > > > Please consider upgrading. I am not entirely sure if HC 4.2 supports
> > TCP keepalive
> > > setting.
> > >
> > > Unfortunately, to upgrade HC we need to upgrade Spring to the latest
> > > version which requires Java 8. But, we cannot force our clients to use
> > Java
> > > 8 yet.
> >
> > There is no need to upgrade Spring. You can upgrade HC dependency to
> > something more recent without upgrading Spring itself.
> >
> > In this case however you should pass a custom instance of HttpClient to
> > ClientHttpRequestFactory
> >
> >
> >
> https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.html#HttpComponentsClientHttpRequestFactory-org.apache.http.client.HttpClient-
> >
> > > However, I don't see SO_KEEPALIVE parameter in the lastest Apache HC
> > > javadocs in "The following parameters can be used to customize the
> > behavior
> > > of this class:" section:
> > >
> >
> https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/client/DefaultHttpClient.html
> > >
> > > Could you please show me example how to set SO_KEEPALIVE parameter in
> new
> > > versions of Apache HC?
> > >
> >
> > ---
> > SocketConfig socketConfig = SocketConfig.custom()
> > .setSoKeepAlive(true)
> > .build();
> > CloseableHttpClient client = HttpClientBuilder.create()
> > .setDefaultSocketConfig(socketConfig)
> > .build();
> > ClientHttpRequestFactory clientfactory = new
> > HttpComponentsClientHttpRequestFactory(client);
> > ---
> >
> > Hope this helps
> >
> > Oleg
> >
> >
> > > Thanks,
> > > Baratali Izmailov.
> > >
> > > On 12 May 2016 at 09:53, Oleg Kalnichevski <ol...@apache.org> wrote:
> > >
> > > > On Thu, 2016-05-12 at 09:23 +0100, Baratali Izmailov wrote:
> > > > > Hello. Thanks for the quick response.
> > > > >
> > > > > > Is there any way you can turn this into 2 requests?
> > > > > For now we cannot split this into 2 HTTP requests, because we have
> to
> > > > > change client-server protocol communication and re-implement some
> > parts
> > > > of
> > > > > our application, which will take much time.
> > > > &

Re: Apache HttpClient TCP Keep-Alive (socket keep-alive)

2016-05-18 Thread ecki
How do you know the keepalive packets have not been sent? Did you run a 
tcpdump? 

The socket API (java and apache) traditionally does not support to configure 
the keepalive times, they only allow to turn it on. 

BTW: still think tcp keepalives are not what you want to rely on and might not 
help to keep a connection open if an intermediate wants to be an annoyance.

Greetings
Bernd

-- 
http://bernd.eckenfels.net

-Original Message-
From: Baratali Izmailov <baratal...@gmail.com>
To: HttpClient User Discussion <httpclient-users@hc.apache.org>
Sent: Mi., 18 Mai 2016 12:37
Subject: Re: Apache HttpClient TCP Keep-Alive (socket keep-alive)

Thank you. I updated Apache HttpClient version as you described. However,
it didn't help, TCP KeepAlive packets were not sent between client and
server.
If correctly understand, the problem is that I cannot edit TCP KeepAlive
timouts in HttpClient or even in Apache httpd server. It works only if I
set timeouts on OS level (in Linux):
sudo sysctl -w net.ipv4.tcp_keepalive_time=60
sudo sysctl -w net.ipv4.tcp_keepalive_intvl=60
sudo sysctl -w net.ipv4.tcp_keepalive_probes=10

With such configs the server sends TCP KeepAlive packets every 60 seconds.

Thanks,
Baratali Izmailov.

On 12 May 2016 at 15:53, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Thu, 2016-05-12 at 13:46 +0100, Baratali Izmailov wrote:
> > > Please consider upgrading. I am not entirely sure if HC 4.2 supports
> TCP keepalive
> > setting.
> >
> > Unfortunately, to upgrade HC we need to upgrade Spring to the latest
> > version which requires Java 8. But, we cannot force our clients to use
> Java
> > 8 yet.
>
> There is no need to upgrade Spring. You can upgrade HC dependency to
> something more recent without upgrading Spring itself.
>
> In this case however you should pass a custom instance of HttpClient to
> ClientHttpRequestFactory
>
>
> https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.html#HttpComponentsClientHttpRequestFactory-org.apache.http.client.HttpClient-
>
> > However, I don't see SO_KEEPALIVE parameter in the lastest Apache HC
> > javadocs in "The following parameters can be used to customize the
> behavior
> > of this class:" section:
> >
> https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/client/DefaultHttpClient.html
> >
> > Could you please show me example how to set SO_KEEPALIVE parameter in new
> > versions of Apache HC?
> >
>
> ---
> SocketConfig socketConfig = SocketConfig.custom()
> .setSoKeepAlive(true)
> .build();
> CloseableHttpClient client = HttpClientBuilder.create()
> .setDefaultSocketConfig(socketConfig)
> .build();
> ClientHttpRequestFactory clientfactory = new
> HttpComponentsClientHttpRequestFactory(client);
> ---
>
> Hope this helps
>
> Oleg
>
>
> > Thanks,
> > Baratali Izmailov.
> >
> > On 12 May 2016 at 09:53, Oleg Kalnichevski <ol...@apache.org> wrote:
> >
> > > On Thu, 2016-05-12 at 09:23 +0100, Baratali Izmailov wrote:
> > > > Hello. Thanks for the quick response.
> > > >
> > > > > Is there any way you can turn this into 2 requests?
> > > > For now we cannot split this into 2 HTTP requests, because we have to
> > > > change client-server protocol communication and re-implement some
> parts
> > > of
> > > > our application, which will take much time.
> > > > I understand that it is not that effective to keep connection open
> too
> > > > long, but it's only simple solution I see for now.
> > > >
> > > > > What version of HttpClient are you using? It looks like something
> > > fairly
> > > > old.
> > > > It is 4.2.2. Actually I use Spring 3.2.1 httpInvoker which uses
> > > > DefaultHttpClient.
> > > >
> > >
> > > Please consider upgrading. I am not entirely sure if HC 4.2 supports
> TCP
> > > keepalive setting.
> > >
> > > Oleg
> > >
> > > > > Using TCP keepalive wont help you with default OS settings, it
> would
> > > not
> > > > start to send them in the first 20 idle minutes.
> > > > Can I configure Apache httpd server to do this (set keep-alive
> timeouts)?
> > > >
> > > > Thanks,
> > > > Baratali.
> > >
> > >
> > >
> > > ---------------------
> > > To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
> > > 

Re: Apache HttpClient TCP Keep-Alive (socket keep-alive)

2016-05-18 Thread Baratali Izmailov
Thank you. I updated Apache HttpClient version as you described. However,
it didn't help, TCP KeepAlive packets were not sent between client and
server.
If correctly understand, the problem is that I cannot edit TCP KeepAlive
timouts in HttpClient or even in Apache httpd server. It works only if I
set timeouts on OS level (in Linux):
sudo sysctl -w net.ipv4.tcp_keepalive_time=60
sudo sysctl -w net.ipv4.tcp_keepalive_intvl=60
sudo sysctl -w net.ipv4.tcp_keepalive_probes=10

With such configs the server sends TCP KeepAlive packets every 60 seconds.

Thanks,
Baratali Izmailov.

On 12 May 2016 at 15:53, Oleg Kalnichevski  wrote:

> On Thu, 2016-05-12 at 13:46 +0100, Baratali Izmailov wrote:
> > > Please consider upgrading. I am not entirely sure if HC 4.2 supports
> TCP keepalive
> > setting.
> >
> > Unfortunately, to upgrade HC we need to upgrade Spring to the latest
> > version which requires Java 8. But, we cannot force our clients to use
> Java
> > 8 yet.
>
> There is no need to upgrade Spring. You can upgrade HC dependency to
> something more recent without upgrading Spring itself.
>
> In this case however you should pass a custom instance of HttpClient to
> ClientHttpRequestFactory
>
>
> https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.html#HttpComponentsClientHttpRequestFactory-org.apache.http.client.HttpClient-
>
> > However, I don't see SO_KEEPALIVE parameter in the lastest Apache HC
> > javadocs in "The following parameters can be used to customize the
> behavior
> > of this class:" section:
> >
> https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/client/DefaultHttpClient.html
> >
> > Could you please show me example how to set SO_KEEPALIVE parameter in new
> > versions of Apache HC?
> >
>
> ---
> SocketConfig socketConfig = SocketConfig.custom()
> .setSoKeepAlive(true)
> .build();
> CloseableHttpClient client = HttpClientBuilder.create()
> .setDefaultSocketConfig(socketConfig)
> .build();
> ClientHttpRequestFactory clientfactory = new
> HttpComponentsClientHttpRequestFactory(client);
> ---
>
> Hope this helps
>
> Oleg
>
>
> > Thanks,
> > Baratali Izmailov.
> >
> > On 12 May 2016 at 09:53, Oleg Kalnichevski  wrote:
> >
> > > On Thu, 2016-05-12 at 09:23 +0100, Baratali Izmailov wrote:
> > > > Hello. Thanks for the quick response.
> > > >
> > > > > Is there any way you can turn this into 2 requests?
> > > > For now we cannot split this into 2 HTTP requests, because we have to
> > > > change client-server protocol communication and re-implement some
> parts
> > > of
> > > > our application, which will take much time.
> > > > I understand that it is not that effective to keep connection open
> too
> > > > long, but it's only simple solution I see for now.
> > > >
> > > > > What version of HttpClient are you using? It looks like something
> > > fairly
> > > > old.
> > > > It is 4.2.2. Actually I use Spring 3.2.1 httpInvoker which uses
> > > > DefaultHttpClient.
> > > >
> > >
> > > Please consider upgrading. I am not entirely sure if HC 4.2 supports
> TCP
> > > keepalive setting.
> > >
> > > Oleg
> > >
> > > > > Using TCP keepalive wont help you with default OS settings, it
> would
> > > not
> > > > start to send them in the first 20 idle minutes.
> > > > Can I configure Apache httpd server to do this (set keep-alive
> timeouts)?
> > > >
> > > > Thanks,
> > > > Baratali.
> > >
> > >
> > >
> > > -
> > > 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
>
>


Re: Apache HttpClient TCP Keep-Alive (socket keep-alive)

2016-05-12 Thread Oleg Kalnichevski
On Thu, 2016-05-12 at 13:46 +0100, Baratali Izmailov wrote:
> > Please consider upgrading. I am not entirely sure if HC 4.2 supports TCP 
> > keepalive
> setting.
> 
> Unfortunately, to upgrade HC we need to upgrade Spring to the latest
> version which requires Java 8. But, we cannot force our clients to use Java
> 8 yet.

There is no need to upgrade Spring. You can upgrade HC dependency to
something more recent without upgrading Spring itself. 

In this case however you should pass a custom instance of HttpClient to
ClientHttpRequestFactory

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.html#HttpComponentsClientHttpRequestFactory-org.apache.http.client.HttpClient-

> However, I don't see SO_KEEPALIVE parameter in the lastest Apache HC
> javadocs in "The following parameters can be used to customize the behavior
> of this class:" section:
> https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/client/DefaultHttpClient.html
> 
> Could you please show me example how to set SO_KEEPALIVE parameter in new
> versions of Apache HC?
> 

---
SocketConfig socketConfig = SocketConfig.custom()
.setSoKeepAlive(true)
.build();
CloseableHttpClient client = HttpClientBuilder.create()
.setDefaultSocketConfig(socketConfig)
.build();
ClientHttpRequestFactory clientfactory = new 
HttpComponentsClientHttpRequestFactory(client); 
---

Hope this helps

Oleg


> Thanks,
> Baratali Izmailov.
> 
> On 12 May 2016 at 09:53, Oleg Kalnichevski  wrote:
> 
> > On Thu, 2016-05-12 at 09:23 +0100, Baratali Izmailov wrote:
> > > Hello. Thanks for the quick response.
> > >
> > > > Is there any way you can turn this into 2 requests?
> > > For now we cannot split this into 2 HTTP requests, because we have to
> > > change client-server protocol communication and re-implement some parts
> > of
> > > our application, which will take much time.
> > > I understand that it is not that effective to keep connection open too
> > > long, but it's only simple solution I see for now.
> > >
> > > > What version of HttpClient are you using? It looks like something
> > fairly
> > > old.
> > > It is 4.2.2. Actually I use Spring 3.2.1 httpInvoker which uses
> > > DefaultHttpClient.
> > >
> >
> > Please consider upgrading. I am not entirely sure if HC 4.2 supports TCP
> > keepalive setting.
> >
> > Oleg
> >
> > > > Using TCP keepalive wont help you with default OS settings, it would
> > not
> > > start to send them in the first 20 idle minutes.
> > > Can I configure Apache httpd server to do this (set keep-alive timeouts)?
> > >
> > > Thanks,
> > > Baratali.
> >
> >
> >
> > -
> > 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



Re: Apache HttpClient TCP Keep-Alive (socket keep-alive)

2016-05-12 Thread Baratali Izmailov
> Please consider upgrading. I am not entirely sure if HC 4.2 supports TCP 
> keepalive
setting.

Unfortunately, to upgrade HC we need to upgrade Spring to the latest
version which requires Java 8. But, we cannot force our clients to use Java
8 yet.
However, I don't see SO_KEEPALIVE parameter in the lastest Apache HC
javadocs in "The following parameters can be used to customize the behavior
of this class:" section:
https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/client/DefaultHttpClient.html

Could you please show me example how to set SO_KEEPALIVE parameter in new
versions of Apache HC?

Thanks,
Baratali Izmailov.

On 12 May 2016 at 09:53, Oleg Kalnichevski  wrote:

> On Thu, 2016-05-12 at 09:23 +0100, Baratali Izmailov wrote:
> > Hello. Thanks for the quick response.
> >
> > > Is there any way you can turn this into 2 requests?
> > For now we cannot split this into 2 HTTP requests, because we have to
> > change client-server protocol communication and re-implement some parts
> of
> > our application, which will take much time.
> > I understand that it is not that effective to keep connection open too
> > long, but it's only simple solution I see for now.
> >
> > > What version of HttpClient are you using? It looks like something
> fairly
> > old.
> > It is 4.2.2. Actually I use Spring 3.2.1 httpInvoker which uses
> > DefaultHttpClient.
> >
>
> Please consider upgrading. I am not entirely sure if HC 4.2 supports TCP
> keepalive setting.
>
> Oleg
>
> > > Using TCP keepalive wont help you with default OS settings, it would
> not
> > start to send them in the first 20 idle minutes.
> > Can I configure Apache httpd server to do this (set keep-alive timeouts)?
> >
> > Thanks,
> > Baratali.
>
>
>
> -
> To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
> For additional commands, e-mail: httpclient-users-h...@hc.apache.org
>
>


Re: Apache HttpClient TCP Keep-Alive (socket keep-alive)

2016-05-12 Thread Oleg Kalnichevski
On Thu, 2016-05-12 at 09:23 +0100, Baratali Izmailov wrote:
> Hello. Thanks for the quick response.
> 
> > Is there any way you can turn this into 2 requests?
> For now we cannot split this into 2 HTTP requests, because we have to
> change client-server protocol communication and re-implement some parts of
> our application, which will take much time.
> I understand that it is not that effective to keep connection open too
> long, but it's only simple solution I see for now.
> 
> > What version of HttpClient are you using? It looks like something fairly
> old.
> It is 4.2.2. Actually I use Spring 3.2.1 httpInvoker which uses
> DefaultHttpClient.
> 

Please consider upgrading. I am not entirely sure if HC 4.2 supports TCP
keepalive setting.

Oleg

> > Using TCP keepalive wont help you with default OS settings, it would not
> start to send them in the first 20 idle minutes.
> Can I configure Apache httpd server to do this (set keep-alive timeouts)?
> 
> Thanks,
> Baratali.



-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



Re: Apache HttpClient TCP Keep-Alive (socket keep-alive)

2016-05-12 Thread Baratali Izmailov
Hello. Thanks for the quick response.

> Is there any way you can turn this into 2 requests?
For now we cannot split this into 2 HTTP requests, because we have to
change client-server protocol communication and re-implement some parts of
our application, which will take much time.
I understand that it is not that effective to keep connection open too
long, but it's only simple solution I see for now.

> What version of HttpClient are you using? It looks like something fairly
old.
It is 4.2.2. Actually I use Spring 3.2.1 httpInvoker which uses
DefaultHttpClient.

> Using TCP keepalive wont help you with default OS settings, it would not
start to send them in the first 20 idle minutes.
Can I configure Apache httpd server to do this (set keep-alive timeouts)?

Thanks,
Baratali.


Re: Apache HttpClient TCP Keep-Alive (socket keep-alive)

2016-05-11 Thread ecki
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



Re: Apache HttpClient TCP Keep-Alive (socket keep-alive)

2016-05-11 Thread Oleg Kalnichevski
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



Re: Apache HttpClient TCP Keep-Alive (socket keep-alive)

2016-05-11 Thread Dan Quaroni
Is there any way you can turn this into 2 requests?  1 to kick off the long
process which stores the results somewhere, and 1 to poll for the results
to get them when they're available?

On Wed, May 11, 2016 at 10:52 AM, 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.
>



-- 
_
*Daniel Quaroni*
*Principal Software Architect*

*office *781.810.2743
*mobile* 617.838.3147
q...@invoke.com