tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Warren" <>
Subject Re: comet end event
Date Tue, 29 Jan 2008 20:09:18 GMT
Could you indulge me and try the client with the sleep?

I see the end event when there's a break/delay between sending a chunk
and sending the last chunk.  It is legal http to send the last chunk
separately from preceding chunks, isn't it?

> getting a -1 on a is normal (even for a regular servlet).

The "read error" indicates slightly more: that
inputstream.isAvailable() is >0 and that returns
-1.  Do I understand correctly in thinking that this -1 can indicate
two different situations: 1) the client sent a last chunk; or 2) the
client socket closed while the server was reading?

If the above is true, it might be nice to have a way to disambiguate
the two situations.  Also, documentation-wise, it might be nice to
comment the servlet code in to indicate that the
-1 can occur on a last chunk as well as a read error.  As a new comet
user, I incorrectly took your sample code block (in the aio doc page)
below to mean that a -1 always indicated some kind of error:

} else if (n < 0) {
  error(event, request, response);


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message