But it seems not relate to my problem here, as I tried both ways. I also try
to close the response writer in addition to closing the event. Is that
necessary?
Another question is that why the TIMEOUT error keeps coming every few
seconds? Is it something intrinsic with the XMLHttpObject or ActiveXObject
used in browser javascript or something wrong in Tomcat?

Thanks!


On Wed, Sep 16, 2009 at 10:14 AM, Filip Hanik - Dev Lists <
devli...@hanik.com> wrote:

> On 09/13/2009 06:51 PM, Hacking Bear wrote:
>
>> On ERROR with subtype other than DISCONNECT, I just ignore it, i.e. no
>> call
>> to event.close() nor trying to close the streams.
>>
>
> an error means you should always close, or you can leave a thread spinning
> call error over and over again, you can't hold on to a CometEvent object
> after its been errored out
>
>
> I also tried to do both on
>> any error but it seems not doing better. Besides, I didn't see any ERROR
>> other than TIMEOUT which repeats every few seconds.
>>
>> Another note is that in my session listener, I need to close the
>> connection.
>> If I don't, then the CPU usage problem would occur as easily in IE as in
>> FF.
>>
>>     public void sessionDestroyed(HttpSessionEvent event) {
>>                 closeSessionConnection(session.getId());
>>
>> Thanks
>>
>>
>> On Sun, Sep 13, 2009 at 2:00 PM, Filip Hanik - Dev Lists<
>> devli...@hanik.com
>>
>>
>>> wrote:
>>>
>>>
>>
>>
>>> Whis is the event.close conditional when there is an error, what if you
>>> get
>>> a Comet report that says
>>>
>>> Type=CometEvent.EventType.ERROR
>>> Subtype=null
>>>
>>> ?
>>>
>>> Filip
>>>
>>> On 09/13/2009 01:25 PM, Hacking Bear wrote:
>>>
>>>
>>>
>>>> } else if (event.getEventType() == CometEvent.EventType.ERROR) {
>>>>             final EventSubType subtype = event.getEventSubType();
>>>>             if (subtype == CometEvent.EventSubType.TIMEOUT) {
>>>>                 log.info("ignore timeout");
>>>>             } else if (subtype ==
>>>> CometEvent.EventSubType.CLIENT_DISCONNECT)
>>>> {
>>>>                 closeSessionConnection(httpSession.getId(), false);
>>>>                 event.close();
>>>>             }
>>>>
>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>>
>>>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to