users@grizzly.java.net

Comet data into the bit bucket

From: John C. Turnbull <ozemale_at_ozemail.com.au>
Date: Sun, 20 Jan 2008 00:33:47 +1100

I have Comet working nicely between servlets and applets except for one
thing. 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. There are no exceptions in either the servlet or the applet and
the servlet really believes it is sending data down the pipe. However, it
just never arrives in the DataInputStream that the applet uses to
communicate with the servlet.

 

This is bad because there doesn't appear to be any way I can detect when
this is occurring in the program and do something about it. All I can come
up with is to do a reconnect if the connection is idle for a certain period
of time in the hope that this will prevent the problem from ever happening.
I cannot say exactly how long the idle time is but it appears to be at least
10 minutes. I have the following line in the servlet:

 

context.setExpirationDelay(-1);

 

which I thought would mean that no timeouts would be happening.

 

Any ideas what's actually happening here and where the data is going?

 

Thanks,

 

-JCT