Andrea Aime ha scritto:
> Andrea Aime ha scritto:
> ...
> 
>> I looked into the servlet API but could find no "supported" way to
>> actually guess if the client connection is still alive
>> or not, it seems one has actually to try and write something
>> on the output.
>> I asked on the Sun J2EE servlet forum and got a couple of answers:
>> http://forums.sun.com/thread.jspa?threadID=5408542
>>
>> The idea of trying to flush() periodically seems to be a good
>> one, I've read in other places that flushing the output
>> stream should not turn the response into committed status:
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4362880
>>
>> The reason it's important that flush() does not commit
>> the response is that by the time one commits the response
>> the headers have to be set and cannot be modified,
>> and our dispatch system sets them only after the response
>> object has been created (the fully rendered image in our case).
>> Since we want to try periodic flush() call during the rendering
>> we would be in troubles, as the headers are set only after that.
> 
> Hmmm... just looked into the source code of Jetty and Tomcat,
> no go:
> - Jetty ServletOutputStream subclass flush() won't do anything unless
>    there is anything written in the output, and if there is, the
>    stuff is sent do the client
> - Tomcat will send the headers to the client as soon as you call it.

Maybe the problem should be attacked the other way, on the input size.
When calling read methods on the input stream they should return -1
if the stream is ended. But what if the connection has been dropped?
_maybe_ they will throw an exception instead.
Worth a try I guess

Cheers
Andrea

-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to