I'm having a problem with firefox not consistently being able to lsiten for
new server sent notification. I'm using Tomcat 7.0.8 and Atmosphere 6.5.
The server will push the server's timestamp to the client every 5 seconds.
In Google Chrome 9.0.597.94 beta:
Works as expected always, that is the pushed response from the server is
appended to the #messages element in the page
FireFox 3.6.13: The messages will not always be received. That is, if one
message is received, then all subsequent messages will also be. However,
there seems to be a problem with the initial "handshake". By refreshing the
page it seems to fix itself. Refresh again and the problem is back.
Example code: http://ethlo.no/codeexamples/asynctest/asynctest.zip
- Run TomcatRunner.java
- Open http://localhost:8080/asynctest/
You should see messages appear in the page.
Using firebug I can see that there are two opened connections and the scripts active connection is not the right one, so subscribe callback never sees any messages. If i move the variable ajaxRequest up as an instance variable like seen below it will work.