users@grizzly.java.net

RE: Comet data into the bit bucket

From: John C. Turnbull <ozemale_at_ozemail.com.au>
Date: Tue, 22 Jan 2008 23:55:54 +1100

Hi Jeanfrancois,

Thanks for your reply. Comments inline.

> > I have Comet working nicely between servlets and applets except for
> one
> > thing.
>
> Great!

[JCT] Yes, indeed. I am very happy with Grizzly Comet :-)
 
> For some reason, if a connection is left idle for several
> > minutes then the data sent from the servlet seems to disappear into
> the
> > ether somewhere.
>
> Do you know how long exactly?

[JCT] Not exactly but it's about 10 minutes.

> Do you have a test case I can take a look at? Do you know if the
> connection is still active (are you handling the
> onInterrupt/onTerminate
> method of the CometHandler)?

[JCT] It is difficult to provide a test case at this stage but I can say
that I am not doing anything with onInterrupt or onTerminate yet as I am not
sure how these methods should be used. Is there documentation for Comet
somewhere? I mean something that gives a general outline of how everything
hangs together? It's a bit hit-or-miss for me at the moment and I am
finding things out by experimentation.

> > Any ideas what's actually happening here and where the data is going?
>
> Difficult to say. Are they any exceptions in the log (I guess not). Do
> you know if the bytes are sent over the network? A tool like wireshark
> or ngrep could help determining if the server or the client have
> problem.

[JCT] I haven't used a packet sniffer to analyse the network yet but I do
know that the server "believes" that the data has been transmitted as the
DataOutputStream#size() method is reporting an ever-increasing number of
transmitted bytes as the data is written and there are no exceptions.

[JCT] So perhaps the problem has something to do with the fact that I am not
properly handling the interrupt or terminate events in the CometHandler but
I still don't know where the data is ending up. When I get a chance I will
do some sniffing around for packets and try to see exactly what is going on.

[JCT] But, as I said, this is the only outstanding issue I have with my
usage of Comet.

Thanks,

-JCT