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 new CometEvent.notify method
Date Thu, 03 May 2007 17:00:16 GMT
Remy Maucherat wrote:
> Filip Hanik - Dev Lists wrote:
>> yes, but that's ok. the sequence would be this
>> a) available() == 1
>> b) InputStream.read() == 0
>> c) available() == 0
>> what this would mean, is that available()==1 means there is data 
>> fetched from the actual socket, may or may not translate into user data.
>> In the sequence above, that is such a case, available returned 1, 
>> cause there was data, read returned 0 cause it didn't translate into 
>> user data, and further attempts to available() showed that there were 
>> no more data to be fetched.
>>
>> When new data comes in, available() (non blocking) again shows up as 
>> 1, InputStream.read() may or may not return data.
>>
>> I personally, think this would be an extremely elegant way to do non 
>> blocking read, as this would also be useful for regular servlets.
>
> No, I don't agree with reading bytes in the lower layer as it would 
> swallow problems even more than doing it in the adapter without any 
> additional benefit (BTW, read cannot return 0). There's also a likely 
> problem that it would require additional structures to hold that data, 
> and which are present in the adapter.
Let's not shut it down quite yet, and move forward, as I think there 
could be some value behind this.
also, why can't read return 0?

More to come
Filip
>
> Rémy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>


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


Mime
View raw message