Yes, this is an interesting use case, I usually issue a read on the BEGIN event. These events are IO related, ie, triggered by IO events and that is what they are. Since the data already has been read in with the request headers,
there will be no following IO event.
You could issue a read() in the BEGIN event, there is absolutely nothing wrong with doing that, as it is the same as a servlet doing a read during the service method.

Filip

Sebastiaan van Erk wrote:
Hi,

The CometProcessor seems to sometimes miss the initial READ event.

THE OBSERVED BEHAVIOR:
The client sends a request to the server. This request (a POST request) is sent in the initial TCP packet. The initial packet also contains some data (a boundary, Content-Disposition: form-data header, etc). The server gets a BEGIN request in which I do some setup; there is already data available for a READ event, but I don't get one. Meanwhile the client sends 10 more bytes of data to the server (which I see passing by in a TCP packet immediately after the request packet). However, I still get no READ event, instead I get a ERROR/TIMEOUT event a bunch later. If the client, instead of doing nothing, waits a couple of seconds and then sends some data, it does get a READ event server side and all the data is read (the boundary, the Content-Disposition header, etc).

Note this happens relatively infrequently, most of the time I do get the initial READ event.

The http://tomcat.apache.org/tomcat-6.0-doc/aio.html documentation clear states that I am not allowed to read from the input stream outside of the READ event; thus I'm not allowed to read in the BEGIN event. So the behavior I expect would be that I immediately get a READ event after the BEGIN event since there is data available.

I figure this is a bug?

Regards,
Sebastiaan

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to