users@grizzly.java.net

multiple tabs and onInterrupt behaviour

From: Eric Luong <eluong_at_ualberta.ca>
Date: Wed, 20 Jul 2011 22:10:12 -0600

I set up a very simple test application where the servlet sends a message to
all clients every 10 seconds and the clients simply keep track of how many
times they have received a message.
I tested it by opening the client on Chrome, Firefox and IE on a Windows 7
machine, as well as Firefox on a Linux machine. Both machines are on the
same subnet. I found that if I opened it TWICE in Firefox, in two tabs,
then only one tab would receive the update when the server pulsed. The tab
that got the update would alternate. The same thing happened in chrome, but
in IE both tabs would update together (as I'd have expected from the
others). Why is this, and is there a way to fix it in Firefox and Chrome?

In addition, I overrode onInterrupt() of CometHandler to send a message to
all clients that would display a message saying that there was an interrupt,
i.e. clients would know when some other client disconnected.

It did not work as I expected. When I closed or refreshed the client pages
in any browser on the windows machine, none of the others would receive the
"interrupt occurred" message. However, if closed or refreshed in Firefox on
the Linux machine, all three browsers on the Windows machine got the
message. Also strange is that sometimes (but not always) they would get the
message twice. Again, I'm trying to understand why...

Finally, I was just wondering if this was the wrong place to ask beginner
questions. If so, I apologize and will look elsewhere.

Thanks for any help and insight I may receive.

Cheers,

Eric Luong