Hi Alexey,
Thanks for your help!
On the Interrupt question, I used netstat on my Windows box as you
suggested and found that connections did seem to remain after closing
the tab. Nonetheless, I expected that given time the connection would
be severed and thus, eventually, the Interrupt would occur. From
netstat I found that, yes, eventually the connection was dropped on the
client side. However, the interrupt never came.
I'm also still wondering why, on the Linux box, closing the connection
would sometimes result in two Interrupts called instead of one.
On the first issue, when you say "new message" in Gmail, do you mean a
new email, or the chat function? I tried testing both. With the chat,
I found that I received new messages in all browsers and tabs. With
emails it was far less consistent. Sometimes all browsers and tabs
would be updated, and other times the updates would only reach some
tabs. For one string of tests, I found just one tab in Firefox was
getting all the updates whereas the other tab got none. But again,
this was not consistent, whereas with my test application in Glassfish,
it was extremely consistent in alternating between open tabs. With 3
or more, it would cycle through them one after another, in consistent
order too.
Possibly part of it was that it took my test emails some time to arrive
(in the tens of seconds), which I was watching in a different browser
where I was actively refreshing. I suppose Gmail is also using a lot
more different strategies with various fallbacks and such, while my own
test app is simple and straightforward.
Once again, thank-you for your insight. :)
Cheers,
Eric