tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: Proposed simplification of CometEvent
Date Sun, 17 Jun 2007 13:41:27 GMT
Costin Manolache wrote:
> On 6/15/07, Filip Hanik - Dev Lists <devlists@hanik.com> wrote:
>
>
> correction, should read
>> I can implement inputstream.read() to return 0 on both blocking and non
>> blocking *Comet events*, (since sockets are always non blocking)
>
>
>
> Ok, my mistake - what I really meant to say is:  I am only interested in
> Comet if it
> behaves similar with non-blocking sockets ( regardless of 
> implementation ),
> i.e. read(), write() called inside
> a comet servlet will never block.
well, then you are out of luck, cause that's not in the running right now.
I earlier proposed that CometEvent would have two new methods
nbRead(ByteBuffer) and nbWrite(ByteBuffer) that would do exactly that.

That proposal was quickly shutdown since we thought that we should still 
be using the Servlet API.
And you can't get NIO socket functionality using streams, readers or 
writers.
>
>> From the description so far it seems the sandbox version has this 
>> property
> and the trunk has
> an option to make it blocking ( or so I understood from your comments ).
>
> I'm not familiar with the concept of 'non blocking *Comet events*' - 
> never
> heard of an event that
> blocks or doesn't block before. If you mean that during a comet event 
> read
> will be blocking (
> based on config or whatever else ) - I think this is a bad design.
That's how 6.0.13 is working, and I don't think its bad design.
Take a look at the first example in
http://people.apache.org/~fhanik/tomcat/aio.html#Example%20code%20snippets
It's a real life example, and clearly shows how much easier it is to 
write code
using blocking read/write methods.

In the current proposal non blocking would also happen on the existing 
Servlet API making it a little harder to program,
but we got there from deciding to stick with the Servlet API and not 
create any new read or write methods.

Filip
>
> Costin
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.472 / Virus Database: 269.9.0/852 - Release Date: 6/17/2007 8:23 AM
>   


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


Mime
View raw message