tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: Connection is closed when CometEvent.close is called during an event
Date Thu, 10 Jun 2010 19:48:47 GMT
2010/6/8 Reich, Matthias <matthias.reich@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message