KeepAlive Connection Handling Strategy

View: New views
2 Messages — Rating Filter:   Alert me  

KeepAlive Connection Handling Strategy

by Hiranya Jayathilaka-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Devs,

I would like to know what is the KeepAlive handling strategy used in HTTP
Core 4.1-alpha1. How does HTTP Core deal with KeepAlive connections at
server side and the client side? Is there a way to configure this behavior?
The article at [1] mentions about a class/interface called
ConnectionKeepAliveStrategy. Does the latest 4.1-alpha1 contain this
feature?

Your response is most appreciated.

Thanks,
Hiranya

[1] - http://hc.apache.org/httpcomponents-client/tutorial/html/connmgmt.html

--
Hiranya Jayathilaka
Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@...;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

Re: KeepAlive Connection Handling Strategy

by olegk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hiranya Jayathilaka wrote:

> Hi Devs,
>
> I would like to know what is the KeepAlive handling strategy used in HTTP
> Core 4.1-alpha1. How does HTTP Core deal with KeepAlive connections at
> server side and the client side? Is there a way to configure this behavior?
> The article at [1] mentions about a class/interface called
> ConnectionKeepAliveStrategy. Does the latest 4.1-alpha1 contain this
> feature?
>
> Your response is most appreciated.
>
> Thanks,
> Hiranya
>
> [1] - http://hc.apache.org/httpcomponents-client/tutorial/html/connmgmt.html
>

Hiranya,

HttpCore components keep connections alive indefinitely both on the
client and the server side. ConnectionKeepAliveStrategy interface is
provided by HttpClient only and is a client specific extension. It is
not available in the core components. If you want to enforce a
keep-alive limit of some kind you have to build this kind of logic into
the protocol handlers used by your application.

I suppose your are only interested in the NIO side of things. There is
an effort to provide a full fledged asynchronous HTTP client based on
HttpCore NIO, similar to what HttpClient is for HttpCore classic, but it
is presently in a VERY, VERY, VERY early development stage:

http://svn.apache.org/repos/asf/httpcomponents/asynchttpclient/trunk/

Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...