You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Oleg Kalnichevski <ol...@apache.org> on 2006/08/30 23:22:09 UTC
[HttpCore] NIO extensions; was Re: [jira] Updated: (HTTPCORE-11)
On Wed, 2006-08-30 at 23:02 +0200, Robert Olofsson wrote:
> Oleg Kalnichevski (JIRA) wrote:
> > [ http://issues.apache.org/jira/browse/HTTPCORE-11?page=all ]
>
> Looking at the patch I see calls to setSoTimeout on the socket that
> DefaultHttpClientConnection has, that seems suspicious if you plan on
> using nio with that. With a selector you have to handle read timeouts
> yourself.
>
> Of course you need to be able to set timeouts, but how you do that might
> need to be handled by the transmitter/receiver.
>
> Since I have not read the code much yet, I hope you will tell me
> if I have totally misunderstood everything :-).
>
Robert,
HttpCore is an abstract API and its default implementation based on Java
1.3 classic I/O. NIO extensions to HttpCore reside in a separate module
and are entirely optional. They can be found here:
http://svn.apache.org/repos/asf/jakarta/httpcomponents/httpcore/trunk/module-nio/
These are some code samples for the impatient
Non-blocking single-threaded echo server:
http://svn.apache.org/repos/asf/jakarta/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/nio/examples/ElementalEchoServer.java
Non-blocking echo server with asynchronous worker threads
http://svn.apache.org/repos/asf/jakarta/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/nio/examples/AsyncEchoServer.java
Asynchronous HTTP server:
http://svn.apache.org/repos/asf/jakarta/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/nio/examples/AsyncHttpServerServer.java
I am going to post a write-up of the NIO extensions API in the coming
days. I am not much of a writer, so do not expect "War and Piece" kind
of stuff. Feel free to look at the source code as the ultimate
reference. Feedback, suggestions, critique will be highly appreciated.
Cheers
Oleg
> /robo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org