2010/6/8 Reich, Matthias <matthias.re...@siemens-enterprise.com>:
> I modified the code (in 6.0.20 and 6.0.26) so that the error flag is not set.
> With that change Tomcat kept the connection open:
>
> ...
>    if (response.isClosed() || !request.isComet()) {
>        if (status==SocketStatus.OPEN) {
>        //CometEvent.close was called during an event.
>        request.getEvent().setEventType(CometEvent.EventType.END);
>        request.getEvent().setEventSubType(null);
>
> // don't set the error flag here - otherwise the connection will be closed
> // whenever a long poll is answered already during event handling:
>        // error = true;
>

1. I think that I do not understand you. What is your meaning of "long
poll"? Can you describe your situation as a sequence of events how
they occur step-by-step on a timeline?

2. The above fragment when using Comet should be equivalent to

>    if (response.isClosed()) {
>        if (status==SocketStatus.OPEN) {
>        //CometEvent.close was called during an event.
>        request.getEvent().setEventType(CometEvent.EventType.END);
>        request.getEvent().setEventSubType(null);
>
> // don't set the error flag here - otherwise the connection will be closed
> // whenever a long poll is answered already during event handling:
>        // error = true;
>

Response#isClosed():
    public boolean isClosed() {
        return outputBuffer.isClosed();
    }

If you will not be able to send your answer, why not to close the
socket right away?

3. It would be much more readable, if you provided your changes in the
unified diff format. (even better if it were generated with "svn diff"
command against sources retrieved from svn).


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to